From: anton Date: Wed, 30 Nov 2005 15:28:11 +0000 (+0000) Subject: * md_init: Use line buffering on vm_out. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=a433a233629f619194dda9c906cb2574d4feee73;p=cacao.git * md_init: Use line buffering on vm_out. --- diff --git a/src/vm/jit/intrp/md.c b/src/vm/jit/intrp/md.c index ef418249a..6e9700471 100644 --- a/src/vm/jit/intrp/md.c +++ b/src/vm/jit/intrp/md.c @@ -30,7 +30,7 @@ Changes: Joseph Wenninger Christian Thalinger - $Id: md.c 3229 2005-09-19 14:04:57Z twisti $ + $Id: md.c 3820 2005-11-30 15:28:11Z anton $ */ @@ -57,6 +57,10 @@ Inst *vm_prim = NULL; /* initialized by md_init() */ void md_init(void) { vm_out = stdout; + if (setvbuf(stdout,NULL, _IOLBF,0) != 0) { + perror("setvbuf error"); + exit(1); + } if ( vm_prim == NULL ) { (void)engine(NULL, NULL, NULL); } @@ -81,14 +85,14 @@ void thread_restartcriticalsection(ucontext_t *uc) *******************************************************************************/ -functionptr md_stacktrace_get_returnaddress(u1 *sp, u4 framesize) +u1 *md_stacktrace_get_returnaddress(u1 *sp, u4 framesize) { - functionptr ra; + u1 *ra; /* ATTENTION: the passed sp is actually the fp! (see java.vmg for stack layout) */ - ra = (functionptr) (ptrint) *((u1 **) (sp - framesize - sizeof(void *))); + ra = *((u1 **) (sp - framesize - sizeof(void *))); return ra; }