summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-30 20:32:17 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-30 20:38:28 -0400
commit7358dc029ab8cb8f9d83eb847389d84f822ccfe8 (patch)
treefb119a569229988b8dbf3408794d41ce0e229442 /src/core/manager.c
parent4a0a74179fcfb85c456794fd91fa2ae5d4d3bc8f (diff)
Convert the rest to sd_bus_errnomap
I tried to preserve most errno values, but in some cases they were inconsistent (different errno values for the same error name) or just mismatched.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index d427d88d4e..ed7fdc71d7 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1189,15 +1189,11 @@ int manager_add_job(Manager *m, JobType type, Unit *unit, JobMode mode, bool ove
assert(unit);
assert(mode < _JOB_MODE_MAX);
- if (mode == JOB_ISOLATE && type != JOB_START) {
- sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Isolate is only valid for start.");
- return -EINVAL;
- }
+ if (mode == JOB_ISOLATE && type != JOB_START)
+ return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Isolate is only valid for start.");
- if (mode == JOB_ISOLATE && !unit->allow_isolate) {
- sd_bus_error_setf(e, BUS_ERROR_NO_ISOLATION, "Operation refused, unit may not be isolated.");
- return -EPERM;
- }
+ if (mode == JOB_ISOLATE && !unit->allow_isolate)
+ return sd_bus_error_setf(e, BUS_ERROR_NO_ISOLATION, "Operation refused, unit may not be isolated.");
log_debug_unit(unit->id,
"Trying to enqueue job %s/%s/%s", unit->id,