journalctl -f redirected to a pipe or file wasn't working for some
output formats but was working for json. It turns out only json was
doing an fflush.
Make all output formats flush.
}
fputs("\n}", stdout);
- fflush(stdout);
return 0;
}
int output_journal(sd_journal *j, OutputMode mode, unsigned line,
unsigned n_columns, OutputFlags flags) {
+ int ret;
assert(mode >= 0);
assert(mode < _OUTPUT_MODE_MAX);
if (n_columns <= 0)
n_columns = columns();
- return output_funcs[mode](j, line, n_columns, flags);
+ ret = output_funcs[mode](j, line, n_columns, flags);
+ fflush(stdout);
+ return ret;
}
int show_journal_by_unit(