1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-31 14:50:15 +03:00

core: change mount_synthesize_root() return to int

Let's propagate the error here, instead of eating it up early.

In a later change we should probably also change mount_enumerate() to propagate
errors up, but that would mean we'd have to change the unit vtable, and thus
change all unit types, hence is quite an invasive change.
This commit is contained in:
Lennart Poettering 2016-11-02 11:38:12 -06:00
parent c69305ff4f
commit 1201cae704

View File

@ -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);