summaryrefslogtreecommitdiff
path: root/src/core/busname.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-27 17:59:45 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-27 17:59:45 +0100
commitc386f5886466de6022b3b4b1c8ac8df72871fbc7 (patch)
treec8ccf30e01db8cce8ece75aaaab2f7d83b281fc9 /src/core/busname.c
parent76583ef261c65feb6059680f95693ee582406c90 (diff)
core: all unit types that watch control PIDs should use the same logic
When coldplugging the unit state, make sure to follow the same basic logic for all unit types: always verify whether the control PID is still a waitable process before proceeding.
Diffstat (limited to 'src/core/busname.c')
-rw-r--r--src/core/busname.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/busname.c b/src/core/busname.c
index 3592f72fe5..68508e20d2 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -364,10 +364,9 @@ static int busname_coldplug(Unit *u) {
if (n->deserialized_state == n->state)
return 0;
- if (IN_SET(n->deserialized_state, BUSNAME_MAKING, BUSNAME_SIGTERM, BUSNAME_SIGKILL)) {
-
- if (n->control_pid <= 0)
- return -EBADMSG;
+ if (n->control_pid > 0 &&
+ pid_is_unwaited(n->control_pid) &&
+ IN_SET(n->deserialized_state, BUSNAME_MAKING, BUSNAME_SIGTERM, BUSNAME_SIGKILL)) {
r = unit_watch_pid(UNIT(n), n->control_pid);
if (r < 0)