projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b010a6a
)
udev: Line buffer 'udev monitor' output (#3733)
author
Stef Walter
<stefw@redhat.com>
Fri, 15 Jul 2016 10:24:34 +0000
(12:24 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 15 Jul 2016 10:24:34 +0000
(12:24 +0200)
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.
src/udev/udevadm-monitor.c
patch
|
blob
|
history
diff --git
a/src/udev/udevadm-monitor.c
b/src/udev/udevadm-monitor.c
index
c0ef073
..
f656c21
100644
(file)
--- 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");