* md_init: Use line buffering on vm_out.
authoranton <none@none>
Wed, 30 Nov 2005 15:28:11 +0000 (15:28 +0000)
committeranton <none@none>
Wed, 30 Nov 2005 15:28:11 +0000 (15:28 +0000)
src/vm/jit/intrp/md.c

index ef418249acf12dc6609154cd27136dc81f1bf45b..6e9700471ed5796744bbda2002fd2bf77d5f3c0a 100644 (file)
@@ -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;
 }