From 07d79af7182c130858a84274718f9d0c84d15109 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 23 Jul 2012 23:38:34 -0500 Subject: Workaround longstanding glibc/ld bug, ala http://sources.redhat.com/bugzilla/show_bug.cgi?id=3400, which prevents "./toybox | wc" from producing any output when toybox was statically linked. --- lib/lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/lib.c b/lib/lib.c index 69029a2c..e7dc45eb 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -160,7 +160,7 @@ void xputs(char *s) void xputc(char c) { - if (EOF == fputc(c, stdout)) perror_exit("write"); + if (EOF == fputc(c, stdout) || fflush(stdout)) perror_exit("write"); } void xflush(void) -- cgit v1.2.3