summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-monitor.c
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2016-07-15 12:24:34 +0200
committerLennart Poettering <lennart@poettering.net>2016-07-15 12:24:34 +0200
commit8d00539d992266050eca672358c185aa2eb0bab3 (patch)
treea98b1ef8f542b4613be69563ddfa0bf7805c8e1e /src/udev/udevadm-monitor.c
parentb010a6a1ae8f3b6903a51513eaecc8de163cf9b5 (diff)
udev: Line buffer 'udev monitor' output (#3733)
Callers of the 'udev monitor' tool expect to see output when an event occurs. The stdio buffering defeats that. This patch switches it to line buffering.
Diffstat (limited to 'src/udev/udevadm-monitor.c')
-rw-r--r--src/udev/udevadm-monitor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c
index c0ef073476..f656c2198e 100644
--- a/src/udev/udevadm-monitor.c
+++ b/src/udev/udevadm-monitor.c
@@ -151,6 +151,9 @@ static int adm_monitor(struct udev *udev, int argc, char *argv[]) {
sigaddset(&mask, SIGTERM);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
+ /* Callers are expecting to see events as they happen: Line buffering */
+ setlinebuf(stdout);
+
fd_ep = epoll_create1(EPOLL_CLOEXEC);
if (fd_ep < 0) {
log_error_errno(errno, "error creating epoll fd: %m");