systat is not flushing output

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

systat is not flushing output

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.c 17 Jan 2019 05:56:29 -0000 1.23
+++ engine.c 19 Jul 2019 15:03:28 -0000
@@ -245,6 +245,7 @@ end_page(void)
  if (rawmode) {
  linepos = 0;
  clear_linebuf();
+        fflush(stdout);
  } else {
  move(home_line, 0);
  print_cmdline();

Reply | Threaded
Open this post in threaded view
|

Re: systat is not flushing output

Todd C. Miller-3
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