aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-04-16 17:14:11 -0500
committerRob Landley <rob@landley.net>2019-04-16 17:14:11 -0500
commit362a6177acbaf38c2eac793a88b233cfeebcc5a1 (patch)
tree6a5964da334bb06f42005ee4ba04f23a8b5280df
parent2a1f89e5d941a77e8c93ad0a5fe78229a4207d61 (diff)
downloadtoybox-362a6177acbaf38c2eac793a88b233cfeebcc5a1.tar.gz
Call setlinebuf(stdout) from singleinit, so automatic flush each \n of output.
Commands that want something different can override this, but it seems like a fairly minor optimization and write(1) exists if we want to micromanage...
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index fdd075d1..5f591904 100644
--- a/main.c
+++ b/main.c
@@ -84,6 +84,7 @@ static void toy_singleinit(struct toy_list *which, char *argv[])
toys.argv = argv;
if (CFG_TOYBOX_I18N) setlocale(LC_CTYPE, "C.UTF-8");
+ setlinebuf(stdout);
// Parse --help and --version for (almost) all commands
if (CFG_TOYBOX_HELP_DASHDASH && !(which->flags & TOYFLAG_NOHELP) && argv[1]) {