aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-07-23 23:38:34 -0500
committerRob Landley <rob@landley.net>2012-07-23 23:38:34 -0500
commit07d79af7182c130858a84274718f9d0c84d15109 (patch)
tree1774612c377ec0411bff86aa0c0d65e666441914
parent8f90d3aa019ff89e19e0977c22be8b73c92109a3 (diff)
downloadtoybox-07d79af7182c130858a84274718f9d0c84d15109.tar.gz
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.0.4.0
-rw-r--r--lib/lib.c2
-rw-r--r--main.c4
2 files changed, 3 insertions, 3 deletions
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)
diff --git a/main.c b/main.c
index 1b1f0fcc..f5994187 100644
--- a/main.c
+++ b/main.c
@@ -133,12 +133,12 @@ void toybox_main(void)
}
len += printf("%s ",toy_list[i].name);
if (len>65) {
- putchar('\n');
+ xputc('\n');
len=0;
}
}
}
- putchar('\n');
+ xputc('\n');
}
int main(int argc, char *argv[])