From ef15ea28a8d1c4adf19aba3f5b32d95fd06b7a49 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 7 Mar 2011 21:18:15 +1100 Subject: [PATCH] Display outputting message only if not testing. --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 8ba4266..994e649 100644 --- a/main.c +++ b/main.c @@ -164,7 +164,7 @@ static int open_tmpoutfile(void) { int fd_out; - if (STDOUT) + if (STDOUT && !TEST_ONLY) print_verbose("Outputting to stdout.\n"); if (control.tmpdir) { control.outfile = realloc(NULL, strlen(control.tmpdir) + 16); @@ -191,7 +191,6 @@ void dump_tmpoutfile(int fd_out) FILE *tmpoutfp; int tmpchar; - print_verbose("Dumping temporary file to stdout.\n"); /* flush anything not yet in the temporary file */ fsync(fd_out); tmpoutfp = fdopen(fd_out, "r"); @@ -200,12 +199,13 @@ void dump_tmpoutfile(int fd_out) rewind(tmpoutfp); if (!TEST_ONLY) { + print_verbose("Dumping temporary file to stdout.\n"); while ((tmpchar = fgetc(tmpoutfp)) != EOF) putchar(tmpchar); + fflush(stdout); + rewind(tmpoutfp); } - fflush(stdout); - rewind(tmpoutfp); if (unlikely(ftruncate(fd_out, 0))) fatal("Failed to ftruncate fd_out in dump_tmpoutfile\n"); }