diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2017-09-29 00:37:23 +0200 |
---|---|---|
committer | Andreas Rammhold <andreas@rammhold.de> | 2017-10-02 13:09:54 +0200 |
commit | 3742095b27f8df4b195d530b52d15bc5fea70bf1 (patch) | |
tree | 3fc7c3503845b733f1d58366436c0bb672d3613a /src/core/job.c | |
parent | man: move non-target units together (#6934) (diff) | |
download | systemd-3742095b27f8df4b195d530b52d15bc5fea70bf1.tar.xz systemd-3742095b27f8df4b195d530b52d15bc5fea70bf1.zip |
tree-wide: use IN_SET where possible
In addition to the changes from #6933 this handles cases that could be
matched with the included cocci file.
Diffstat (limited to 'src/core/job.c')
-rw-r--r-- | src/core/job.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/core/job.c b/src/core/job.c index f04c8a2168..f962881a12 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -368,19 +368,13 @@ bool job_type_is_redundant(JobType a, UnitActiveState b) { switch (a) { case JOB_START: - return - b == UNIT_ACTIVE || - b == UNIT_RELOADING; + return IN_SET(b, UNIT_ACTIVE, UNIT_RELOADING); case JOB_STOP: - return - b == UNIT_INACTIVE || - b == UNIT_FAILED; + return IN_SET(b, UNIT_INACTIVE, UNIT_FAILED); case JOB_VERIFY_ACTIVE: - return - b == UNIT_ACTIVE || - b == UNIT_RELOADING; + return IN_SET(b, UNIT_ACTIVE, UNIT_RELOADING); case JOB_RELOAD: return @@ -888,7 +882,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool alr goto finish; } - if (result == JOB_FAILED || result == JOB_INVALID) + if (IN_SET(result, JOB_FAILED, JOB_INVALID)) j->manager->n_failed_jobs++; job_uninstall(j); |