summaryrefslogtreecommitdiff
path: root/src/core/job.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-02 21:52:51 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-02 22:12:02 -0500
commit6a371e23ee0e47827fb4e3aa469ed84da2599304 (patch)
tree3ce1c39507ad8a9a20a19f52ebb58e424ba27f6b /src/core/job.c
parentc71ecee578fa2d89d13f11edd7b27001f663bbb5 (diff)
systemd: treat reload failure as failure
systemctl reload "suceeded" on stopped units, but it is documented to fail in this case. https://bugzilla.redhat.com/show_bug.cgi?id=1036845
Diffstat (limited to 'src/core/job.c')
-rw-r--r--src/core/job.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/job.c b/src/core/job.c
index 557917a70b..ce97263f03 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -508,7 +508,7 @@ int job_run_and_invalidate(Job *j) {
else if (t == UNIT_ACTIVATING)
r = -EAGAIN;
else
- r = -ENOEXEC;
+ r = -EBADR;
break;
}
@@ -537,8 +537,10 @@ int job_run_and_invalidate(Job *j) {
if (j) {
if (r == -EALREADY)
r = job_finish_and_invalidate(j, JOB_DONE, true);
- else if (r == -ENOEXEC)
+ else if (r == -EBADR)
r = job_finish_and_invalidate(j, JOB_SKIPPED, true);
+ else if (r == -ENOEXEC)
+ r = job_finish_and_invalidate(j, JOB_INVALID, true);
else if (r == -EAGAIN) {
j->state = JOB_WAITING;
m->n_running_jobs--;
@@ -764,7 +766,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive) {
goto finish;
}
- if (result == JOB_FAILED)
+ if (result == JOB_FAILED || result == JOB_INVALID)
j->manager->n_failed_jobs ++;
job_uninstall(j);
@@ -1119,7 +1121,8 @@ static const char* const job_result_table[_JOB_RESULT_MAX] = {
[JOB_TIMEOUT] = "timeout",
[JOB_FAILED] = "failed",
[JOB_DEPENDENCY] = "dependency",
- [JOB_SKIPPED] = "skipped"
+ [JOB_SKIPPED] = "skipped",
+ [JOB_INVALID] = "invalid",
};
DEFINE_STRING_TABLE_LOOKUP(job_result, JobResult);