From: Rusty Russell Date: Wed, 27 Oct 2010 11:49:44 +0000 (+1030) Subject: tap: restore buffering to stdout X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=b734bbea227ae0c326a0f19f84b490d8895b2010 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. --- diff --git a/ccan/tap/tap.c b/ccan/tap/tap.c index a5156aa1..857528a2 100644 --- a/ccan/tap/tap.c +++ b/ccan/tap/tap.c @@ -260,7 +260,7 @@ _tap_init(void) /* stdout needs to be unbuffered so that the output appears in the same place relative to stderr output as it does with Test::Harness */ - setbuf(stdout, 0); +// setbuf(stdout, 0); run_once = 1; } } diff --git a/ccan/tap/test/run.c b/ccan/tap/test/run.c index efc8134d..37f26ae0 100644 --- a/ccan/tap/test/run.c +++ b/ccan/tap/test/run.c @@ -66,8 +66,8 @@ int main(int argc, char *argv[]) int p[2]; int stdoutfd; + setbuf(stdout, 0); printf("1..1\n"); - fflush(stdout); stderrfd = dup(STDERR_FILENO); if (stderrfd < 0) err(1, "dup of stderr failed");