diff options
Diffstat (limited to 'src/core/slice.c')
-rw-r--r-- | src/core/slice.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/slice.c b/src/core/slice.c index ee5c25932f..94eb56e1ca 100644 --- a/src/core/slice.c +++ b/src/core/slice.c @@ -94,19 +94,15 @@ static int slice_verify(Slice *s) { assert(s); assert(UNIT(s)->load_state == UNIT_LOADED); - if (!slice_name_is_valid(UNIT(s)->id)) { - log_unit_error(UNIT(s), "Slice name %s is not valid. Refusing.", UNIT(s)->id); - return -ENOEXEC; - } + if (!slice_name_is_valid(UNIT(s)->id)) + return log_unit_error_errno(UNIT(s), SYNTHETIC_ERRNO(ENOEXEC), "Slice name %s is not valid. Refusing.", UNIT(s)->id); r = slice_build_parent_slice(UNIT(s)->id, &parent); if (r < 0) return log_unit_error_errno(UNIT(s), r, "Failed to determine parent slice: %m"); - if (parent ? !unit_has_name(UNIT_DEREF(UNIT(s)->slice), parent) : UNIT_ISSET(UNIT(s)->slice)) { - log_unit_error(UNIT(s), "Located outside of parent slice. Refusing."); - return -ENOEXEC; - } + if (parent ? !unit_has_name(UNIT_DEREF(UNIT(s)->slice), parent) : UNIT_ISSET(UNIT(s)->slice)) + return log_unit_error_errno(UNIT(s), SYNTHETIC_ERRNO(ENOEXEC), "Located outside of parent slice. Refusing."); return 0; } |