From 21579acacbd962c2a69d882194ba50fba3bffcfe Mon Sep 17 00:00:00 2001 From: mav Date: Wed, 6 Mar 2019 15:19:04 +0000 Subject: [PATCH] Flush stdout after each iteration. Without this, if output is redirected from the console, it is buffered for too long, making tool quite unusable. MFC after: 1 week Sponsored by: iXsystems, Inc. --- usr.bin/ctlstat/ctlstat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/ctlstat/ctlstat.c b/usr.bin/ctlstat/ctlstat.c index 34e340faddea..6586430172ce 100644 --- a/usr.bin/ctlstat/ctlstat.c +++ b/usr.bin/ctlstat/ctlstat.c @@ -717,6 +717,7 @@ main(int argc, char **argv) } fprintf(stdout, "\n"); + fflush(stdout); ctx.flags &= ~CTLSTAT_FLAG_FIRST_RUN; if (count != 1) sleep(waittime);