summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-05-30 14:54:24 +0200
committerMike Yuan <me@yhndnzj.com>2024-07-17 17:25:20 +0200
commit4e8b11ca16a94c2fd6e49e1585a941bb968031dc (patch)
tree2fa14767edcaf01e92d1ffed404c2f459080cd93 /src
parentMerge pull request #33714 from poettering/make-varlink-public (diff)
downloadsystemd-4e8b11ca16a94c2fd6e49e1585a941bb968031dc.tar.xz
systemd-4e8b11ca16a94c2fd6e49e1585a941bb968031dc.zip
core/dbus-unit: use UNIT_IS_LOAD_ERROR where appropriate
Diffstat (limited to '')
-rw-r--r--src/core/dbus-unit.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index 707644d2f9..0161a1bf45 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -1807,9 +1807,7 @@ int bus_unit_queue_job_one(
type = JOB_TRY_RELOAD;
}
- if (type == JOB_STOP &&
- IN_SET(u->load_state, UNIT_NOT_FOUND, UNIT_ERROR, UNIT_BAD_SETTING) &&
- unit_active_state(u) == UNIT_INACTIVE)
+ if (type == JOB_STOP && UNIT_IS_LOAD_ERROR(u->load_state) && unit_active_state(u) == UNIT_INACTIVE)
return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s not loaded.", u->id);
if ((type == JOB_START && u->refuse_manual_start) ||