From a68971cc1cba2bb0c3d8e78903581191670ee149 Mon Sep 17 00:00:00 2001 From: Jim Date: Wed, 17 Aug 2011 09:35:01 -0400 Subject: [PATCH] Flush tracefile every line only when "flush" arg is used. This is useful for situations where the emulator bombs, eg, with a Unix seg fault. But it's slower too, so make it optional. --- em.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/em.c b/em.c index 7620b8b..e75054f 100644 --- a/em.c +++ b/em.c @@ -4438,7 +4438,6 @@ main (int argc, char **argv) { perror("Unable to open trace.log"); exit(1); } - setlinebuf(gvp->tracefile); #endif /* initialize dispatch tables */ @@ -4631,6 +4630,8 @@ main (int argc, char **argv) { gvp->traceflags |= T_GET; else if (strcmp(argv[i],"all") == 0) gvp->traceflags = ~0; + else if (strcmp(argv[i],"flush") == 0) + setlinebuf(gvp->tracefile); else if (isdigit(argv[i][0]) && strlen(argv[i]) <= 2 && sscanf(argv[i],"%d", &templ) == 1) gvp->traceuser = 0100000 | (templ<<6); /* form OWNERL for user # */ else if (isdigit(argv[i][0]) && sscanf(argv[i],"%d", &templ) == 1)