summaryrefslogtreecommitdiffstats
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-01-22 17:51:53 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-23 21:29:31 +0100
commit9acac21249b58f55a120a0d492aa5a26ecb37204 (patch)
treee9b1ecf104130c59b2ea0ca50c0556a70391b216 /src/core/service.c
parentservice: don't bother with watching PIDs during deserialization (diff)
downloadsystemd-9acac21249b58f55a120a0d492aa5a26ecb37204.tar.xz
systemd-9acac21249b58f55a120a0d492aa5a26ecb37204.zip
service: simplify condition
The left side of the || expression is conditionalized on SERVICE_START, but SERVICE_START is blanket listed on the right side anyway, hence we can drop the left side entirely without any change in behaviour. Moreover, if main_pid is initialized, it should be watched, hence this is even the safe and right thing to do.
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 08362510fc..81c776cd15 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1133,8 +1133,7 @@ static int service_coldplug(Unit *u) {
if (s->main_pid > 0 &&
pid_is_unwaited(s->main_pid) &&
- ((s->deserialized_state == SERVICE_START && IN_SET(s->type, SERVICE_FORKING, SERVICE_DBUS, SERVICE_ONESHOT, SERVICE_NOTIFY)) ||
- IN_SET(s->deserialized_state,
+ (IN_SET(s->deserialized_state,
SERVICE_START, SERVICE_START_POST,
SERVICE_RUNNING, SERVICE_RELOAD,
SERVICE_STOP, SERVICE_STOP_SIGABRT, SERVICE_STOP_SIGTERM, SERVICE_STOP_SIGKILL, SERVICE_STOP_POST,