svn commit: r345115 - stable/12/usr.bin/ctlstat

Alexander Motin mav at FreeBSD.org
Wed Mar 13 20:28:50 UTC 2019


Author: mav
Date: Wed Mar 13 20:28:48 2019
New Revision: 345115
URL: https://svnweb.freebsd.org/changeset/base/345115

Log:
  MFC r344844: Flush stdout after each iteration.
  
  Without this, if output is redirected from the console, it is buffered for
  too long, making tool quite unusable.

Modified:
  stable/12/usr.bin/ctlstat/ctlstat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/ctlstat/ctlstat.c
==============================================================================
--- stable/12/usr.bin/ctlstat/ctlstat.c	Wed Mar 13 20:28:07 2019	(r345114)
+++ stable/12/usr.bin/ctlstat/ctlstat.c	Wed Mar 13 20:28:48 2019	(r345115)
@@ -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