summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorypf791 <ypf791@gmail.com>2019-07-19 18:28:04 +0800
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-09-21 23:01:49 +0200
commita20a2157a85dd277c5dc1398fd75f565ca941933 (patch)
treebba14ba060fc0871ddb84eed08a5a952707c84ee
parenteb552417420fa9680b508519e926b140d5a0be25 (diff)
downloadsystemd-a20a2157a85dd277c5dc1398fd75f565ca941933.tar.gz
core: coldplug possible nop_job
(cherry picked from commit b49e14d5f3081dfcd363d8199a14c0924ae9152f)
-rw-r--r--src/core/unit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 64eb12733a..cedcb3f5b3 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -3900,6 +3900,7 @@ int unit_add_node_dependency(Unit *u, const char *what, bool wants, UnitDependen
int unit_coldplug(Unit *u) {
int r = 0, q;
char **i;
+ Job *uj;
assert(u);
@@ -3922,8 +3923,9 @@ int unit_coldplug(Unit *u) {
r = q;
}
- if (u->job) {
- q = job_coldplug(u->job);
+ uj = u->job ?: u->nop_job;
+ if (uj) {
+ q = job_coldplug(uj);
if (q < 0 && r >= 0)
r = q;
}