From 362a6177acbaf38c2eac793a88b233cfeebcc5a1 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 16 Apr 2019 17:14:11 -0500 Subject: 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... --- main.c | 1 + 1 file changed, 1 insertion(+) 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]) { -- cgit v1.2.3