Re: systat is not flushing output

2019-07-19 Thread Todd C . Miller
On Fri, 19 Jul 2019 17:16:00 +0200, Solene Rapenne wrote:

> I wanted to use systat -b -d 10 iostat 1 | something to parse output in
> real time but it was not possible, systat doesn't flush output.
>
> otto@ suggested this change, I tried it and it works.
>
> This flush output at the end of writing a page in raw mode (-B or -b
> flags).

OK millert@ if you fix the whitespace (should use tabs for indent
and match the indent of the preceding lines).

 - todd



systat is not flushing output

2019-07-19 Thread Solene Rapenne
I wanted to use systat -b -d 10 iostat 1 | something to parse output in
real time but it was not possible, systat doesn't flush output.

otto@ suggested this change, I tried it and it works.

This flush output at the end of writing a page in raw mode (-B or -b
flags).

ok?

Index: engine.c
===
RCS file: /data/cvs/src/usr.bin/systat/engine.c,v
retrieving revision 1.23
diff -u -p -r1.23 engine.c
--- engine.c17 Jan 2019 05:56:29 -  1.23
+++ engine.c19 Jul 2019 15:03:28 -
@@ -245,6 +245,7 @@ end_page(void)
if (rawmode) {
linepos = 0;
clear_linebuf();
+fflush(stdout);
} else {
move(home_line, 0);
print_cmdline();