summaryrefslogtreecommitdiff
path: root/src/core/slice.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2020-11-26 09:27:21 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2020-11-27 14:35:20 +0900
commitd85ff94477b9b1e1b8f45f92eaa4eb8f834f6499 (patch)
tree4d597d84bfc0ee7b38850af574328ba9629170c2 /src/core/slice.c
parent2762ce2d89336d5e62ad4fb1984e7d9777e1c3c5 (diff)
downloadsystemd-d85ff94477b9b1e1b8f45f92eaa4eb8f834f6499.tar.gz
core: use SYNTHETIC_ERRNO() macro
Diffstat (limited to 'src/core/slice.c')
-rw-r--r--src/core/slice.c12
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;
}