chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
notify: add minimal readiness/status protocol for spawned daemons
[elogind.git]
/
src
/
socket.c
diff --git
a/src/socket.c
b/src/socket.c
index 19f1d2209736a6afe878d6ac44ae2cb73488008a..66131f867d7a6e240a35722a2ae957c9f316a580 100644
(file)
--- 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);
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;
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);
if (s->control_command)
exec_status_fill(&s->control_command->exec_status, pid, code, status);