summaryrefslogtreecommitdiff
path: root/src/core/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/scope.c')
-rw-r--r--src/core/scope.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core/scope.c b/src/core/scope.c
index 77f3fdc2aa..d6e1f8e392 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -563,16 +563,9 @@ static void scope_enumerate(Manager *m) {
u = manager_get_unit(m, SPECIAL_INIT_SCOPE);
if (!u) {
- u = unit_new(m, sizeof(Scope));
- if (!u) {
- log_oom();
- return;
- }
-
- r = unit_add_name(u, SPECIAL_INIT_SCOPE);
+ r = unit_new_for_name(m, sizeof(Scope), SPECIAL_INIT_SCOPE, &u);
if (r < 0) {
- unit_free(u);
- log_error_errno(r, "Failed to add the " SPECIAL_INIT_SCOPE " name: %m");
+ log_error_errno(r, "Failed to allocate the special " SPECIAL_INIT_SCOPE " unit: %m");
return;
}
}