Skip to content

Commit

Permalink
udev: Line buffer 'udev monitor' output (systemd#3733)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stefwalter authored and poettering committed Jul 15, 2016
1 parent b010a6a commit 8d00539
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/udev/udevadm-monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 8d00539

Please sign in to comment.