summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/mount.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/mount.c b/src/core/mount.c
index 0641621d8f..d749e49df5 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -1599,7 +1599,7 @@ static int mount_get_timeout(Unit *u, usec_t *timeout) {
return 1;
}
-static void synthesize_root_mount(Manager *m) {
+static int synthesize_root_mount(Manager *m) {
Unit *u;
int r;
@@ -1611,10 +1611,8 @@ static void synthesize_root_mount(Manager *m) {
u = manager_get_unit(m, SPECIAL_ROOT_MOUNT);
if (!u) {
r = unit_new_for_name(m, sizeof(Mount), SPECIAL_ROOT_MOUNT, &u);
- if (r < 0) {
- log_error_errno(r, "Failed to allocate the special " SPECIAL_ROOT_MOUNT " unit: %m");
- return;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to allocate the special " SPECIAL_ROOT_MOUNT " unit: %m");
}
u->perpetual = true;
@@ -1622,6 +1620,8 @@ static void synthesize_root_mount(Manager *m) {
unit_add_to_load_queue(u);
unit_add_to_dbus_queue(u);
+
+ return 0;
}
static bool mount_is_mounted(Mount *m) {
@@ -1635,7 +1635,9 @@ static void mount_enumerate(Manager *m) {
assert(m);
- synthesize_root_mount(m);
+ r = synthesize_root_mount(m);
+ if (r < 0)
+ goto fail;
mnt_init_debug(0);