summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-13 21:20:53 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-13 23:42:17 -0400
commitcd972d6911b0e1403e0a11408be732fc3a513f2b (patch)
tree185c31a8528154c68f44b0b72d6aa941715cd59f
parent3164e3cbc50b8754c51f1fdeda7a7d6cedcc39b6 (diff)
core: don't wait for reply if writing to pipe fails
This shouldn't really happen, but it's seems cleaner to continue on error. CID #1237552.
-rw-r--r--src/core/execute.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 39ec5adbb..02df51b5b 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1159,10 +1159,10 @@ static void do_idle_pipe_dance(int idle_pipe[4]) {
if (idle_pipe[3] >= 0 && r == 0 /* timeout */) {
/* Signal systemd that we are bored and want to continue. */
- write(idle_pipe[3], "x", 1);
-
- /* Wait for systemd to react to the signal above. */
- fd_wait_for_event(idle_pipe[0], POLLHUP, IDLE_TIMEOUT2_USEC);
+ r = write(idle_pipe[3], "x", 1);
+ if (r > 0)
+ /* Wait for systemd to react to the signal above. */
+ fd_wait_for_event(idle_pipe[0], POLLHUP, IDLE_TIMEOUT2_USEC);
}
safe_close(idle_pipe[0]);