summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-16 05:10:31 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-16 05:10:31 +0200
commit8c47c7325fa1ab72febf807f8831ff24c75fbf45 (patch)
tree3a116267ab7c0edbfdb32bbd2b6ea222436fcce3 /src/socket.c
parent17586c16bac1d5ecf7d60ef57d18e82e36c288c1 (diff)
notify: add minimal readiness/status protocol for spawned daemons
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/socket.c b/src/socket.c
index 19f1d22097..66131f867d 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1228,12 +1228,14 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) {
assert(s);
assert(pid >= 0);
- success = is_clean_exit(code, status);
- s->failure = s->failure || !success;
+ if (pid != s->control_pid)
+ return;
- assert(s->control_pid == pid);
s->control_pid = 0;
+ success = is_clean_exit(code, status);
+ s->failure = s->failure || !success;
+
if (s->control_command)
exec_status_fill(&s->control_command->exec_status, pid, code, status);