svn commit: r344844 - head/usr.bin/ctlstat

Alexander Motin mav at FreeBSD.org
Wed Mar 6 15:19:05 UTC 2019


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);


More information about the svn-src-all mailing list