Skip to content

Commit

Permalink
Flush stdout after each iteration.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
amotin committed Mar 6, 2019
1 parent 34d5464 commit fcc8734
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions usr.bin/ctlstat/ctlstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fcc8734

Please sign in to comment.