Commit b734bbea authored by Rusty Russell's avatar Rusty Russell

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.
parent d1cea3eb
...@@ -260,7 +260,7 @@ _tap_init(void) ...@@ -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;
} }
} }
......
...@@ -66,8 +66,8 @@ int main(int argc, char *argv[]) ...@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment