From fcc8734127b12049a00286b6ef5860341ce86859 Mon Sep 17 00:00:00 2001 From: Alexander Motin 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 34e340fadde..6586430172c 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);