X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsocket.c;h=66131f867d7a6e240a35722a2ae957c9f316a580;hp=19f1d2209736a6afe878d6ac44ae2cb73488008a;hb=8c47c7325fa1ab72febf807f8831ff24c75fbf45;hpb=17586c16bac1d5ecf7d60ef57d18e82e36c288c1 diff --git a/src/socket.c b/src/socket.c index 19f1d2209..66131f867 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);