diff options
author | Daniel Mack <github@zonque.org> | 2015-09-13 20:44:30 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-09-13 20:44:30 +0200 |
commit | 5669ef3644e3044036eeaaf6bb4b1a6a7e63130c (patch) | |
tree | 1f2f6f436e6070aeea41960ed91fee8705d2aac3 /src/core/execute.c | |
parent | 2d0fd6e1c5bbaddef56ecf0fc8c59478fb9ba822 (diff) | |
parent | e7ab4d1ac9f8d99eecd5e2d22eb482a1fb0fbf23 (diff) |
Merge pull request #1251 from poettering/cgroups-cleanup
cgroups cleanup + other fixes
Diffstat (limited to 'src/core/execute.c')
-rw-r--r-- | src/core/execute.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/execute.c b/src/core/execute.c index d1acda6682..3c308e3e3e 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -1160,8 +1160,8 @@ static void do_idle_pipe_dance(int idle_pipe[4]) { assert(idle_pipe); - safe_close(idle_pipe[1]); - safe_close(idle_pipe[2]); + idle_pipe[1] = safe_close(idle_pipe[1]); + idle_pipe[2] = safe_close(idle_pipe[2]); if (idle_pipe[0] >= 0) { int r; @@ -1169,18 +1169,20 @@ static void do_idle_pipe_dance(int idle_pipe[4]) { r = fd_wait_for_event(idle_pipe[0], POLLHUP, IDLE_TIMEOUT_USEC); if (idle_pipe[3] >= 0 && r == 0 /* timeout */) { + ssize_t n; + /* Signal systemd that we are bored and want to continue. */ - r = write(idle_pipe[3], "x", 1); - if (r > 0) + n = write(idle_pipe[3], "x", 1); + if (n > 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]); + idle_pipe[0] = safe_close(idle_pipe[0]); } - safe_close(idle_pipe[3]); + idle_pipe[3] = safe_close(idle_pipe[3]); } static int build_environment( |