diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-03-08 01:43:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-03-08 01:53:47 +0100 |
commit | 81253930180bac6b6fb372a9c7bea724bd795c86 (patch) | |
tree | 8261ef735745cd499910906134008ac2aba730e8 /src/job.c | |
parent | 85f0c93a50c14cebf0be2740de64c14f27ac61b3 (diff) |
job: convert job type as early as we can, to simplify things a bit
Diffstat (limited to 'src/job.c')
-rw-r--r-- | src/job.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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; } |