diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2015-07-04 12:11:22 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-14 10:05:55 +0100 |
commit | 260ec60412d6488016a39c8f8ee58273e2514ab1 (patch) | |
tree | c29700bdfe8803862945fc46b42bee3a3ff4d0b5 | |
parent | b767c85a403ee56b5f87bc9414638b857dabd18d (diff) |
busctl: flush stdout after dumping data
Running `busctl monitor` currently buffers data for several seconds /
kilobytes before writing stdout. This is highly confusing if you dump in a
file, ^C busctl and then end up with a file with data of the last few
_seconds_ missing.
Fix this by explicitly flushing after each signal.
-rw-r--r-- | src/libelogind/sd-bus/busctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libelogind/sd-bus/busctl.c b/src/libelogind/sd-bus/busctl.c index 704939c6c..6aaaf0e5e 100644 --- a/src/libelogind/sd-bus/busctl.c +++ b/src/libelogind/sd-bus/busctl.c @@ -1137,6 +1137,7 @@ static int monitor(sd_bus *bus, char *argv[], int (*dump)(sd_bus_message *m, FIL if (m) { dump(m, stdout); + fflush(stdout); if (sd_bus_message_is_signal(m, "org.freedesktop.DBus.Local", "Disconnected") > 0) { log_info("Connection terminated, exiting."); |