From: Yu Watanabe Date: Tue, 25 Dec 2018 15:36:55 +0000 (+0900) Subject: udev-event: do not read stdout or stderr if the pipefd is not created X-Git-Tag: archive/raspbian/240-2+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e3a02446c527b98b7c7450e43d59cdd3af286546;p=systemd.git udev-event: do not read stdout or stderr if the pipefd is not created Fixes #11255. Gbp-Pq: Topic debian Gbp-Pq: Name udev-event-do-not-read-stdout-or-stderr-if-the-pipefd-is-.patch --- diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index f601a0be..ebeae329 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -570,13 +570,17 @@ static int spawn_wait(Spawn *spawn) { } } - r = sd_event_add_io(e, NULL, spawn->fd_stdout, EPOLLIN, on_spawn_io, spawn); - if (r < 0) - return r; + if (spawn->fd_stdout >= 0) { + r = sd_event_add_io(e, NULL, spawn->fd_stdout, EPOLLIN, on_spawn_io, spawn); + if (r < 0) + return r; + } - r = sd_event_add_io(e, NULL, spawn->fd_stderr, EPOLLIN, on_spawn_io, spawn); - if (r < 0) - return r; + if (spawn->fd_stderr >= 0) { + r = sd_event_add_io(e, NULL, spawn->fd_stderr, EPOLLIN, on_spawn_io, spawn); + if (r < 0) + return r; + } r = sd_event_add_child(e, NULL, spawn->pid, WEXITED, on_spawn_sigchld, spawn); if (r < 0)