summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-07-04 12:11:22 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-07-04 12:23:39 +0200
commit1d44f7584a713ab24e1ead541a8c85e176b99fd2 (patch)
tree20ca5942fa55347973f706718b5e154f0682ebdb
parent2812dcba85435c59203268ab54901a72c6c24a69 (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/libsystemd/sd-bus/busctl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index 39caa4e7d6..5011c270a0 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/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.");