Browse Source

tap: restore buffering to stdout

I noticed this when I straced something; we're doing 1-byte writes.
This reduced the time for "make check" from 12m37s to 11m48s.
Rusty Russell 15 years ago
parent
commit
b734bbea22
2 changed files with 2 additions and 2 deletions
  1. 1 1
      ccan/tap/tap.c
  2. 1 1
      ccan/tap/test/run.c

+ 1 - 1
ccan/tap/tap.c

@@ -260,7 +260,7 @@ _tap_init(void)
 		/* stdout needs to be unbuffered so that the output appears
 		/* stdout needs to be unbuffered so that the output appears
 		   in the same place relative to stderr output as it does 
 		   in the same place relative to stderr output as it does 
 		   with Test::Harness */
 		   with Test::Harness */
-		setbuf(stdout, 0);
+//		setbuf(stdout, 0);
 		run_once = 1;
 		run_once = 1;
 	}
 	}
 }
 }

+ 1 - 1
ccan/tap/test/run.c

@@ -66,8 +66,8 @@ int main(int argc, char *argv[])
 	int p[2];
 	int p[2];
 	int stdoutfd;
 	int stdoutfd;
 
 
+	setbuf(stdout, 0);
 	printf("1..1\n");
 	printf("1..1\n");
-	fflush(stdout);
 	stderrfd = dup(STDERR_FILENO);
 	stderrfd = dup(STDERR_FILENO);
 	if (stderrfd < 0)
 	if (stderrfd < 0)
 		err(1, "dup of stderr failed");
 		err(1, "dup of stderr failed");