summaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/job.c b/src/job.c
index 54bd4147e2..206490ffbb 100644
--- a/src/job.c
+++ b/src/job.c
@@ -422,10 +422,16 @@ int job_run_and_invalidate(Job *j) {
break;
case JOB_RELOAD_OR_START:
- if (unit_active_state(j->unit) == UNIT_ACTIVE)
+ if (unit_active_state(j->unit) == UNIT_ACTIVE) {
+ j->type = JOB_RELOAD;
r = unit_reload(j->unit);
- else
+ } else {
+ j->type = JOB_START;
r = unit_start(j->unit);
+
+ if (r == -EBADR)
+ r = 0;
+ }
break;
case JOB_RESTART: {
@@ -445,8 +451,10 @@ int job_run_and_invalidate(Job *j) {
else if (t == UNIT_ACTIVATING) {
j->type = JOB_START;
r = unit_start(j->unit);
- } else
+ } else {
+ j->type = JOB_RESTART;
r = unit_stop(j->unit);
+ }
break;
}