summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
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);