Author: mav
Date: Wed Mar  6 15:19:04 2019
New Revision: 344844
URL: https://svnweb.freebsd.org/changeset/base/344844

Log:
  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.

Modified:
  head/usr.bin/ctlstat/ctlstat.c

Modified: head/usr.bin/ctlstat/ctlstat.c
==============================================================================
--- head/usr.bin/ctlstat/ctlstat.c      Wed Mar  6 08:52:02 2019        
(r344843)
+++ head/usr.bin/ctlstat/ctlstat.c      Wed Mar  6 15:19:04 2019        
(r344844)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to