core/mount: report accurate can_start and can_reload
This commit is contained in:
@@ -1424,6 +1424,12 @@ static int mount_reload(Unit *u) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool mount_can_reload(Unit *u) {
|
||||
Mount *m = ASSERT_PTR(MOUNT(u));
|
||||
|
||||
return get_mount_parameters_fragment(m);
|
||||
}
|
||||
|
||||
static int mount_serialize(Unit *u, FILE *f, FDSet *fds) {
|
||||
Mount *m = ASSERT_PTR(MOUNT(u));
|
||||
|
||||
@@ -2361,6 +2367,9 @@ static int mount_can_start(Unit *u) {
|
||||
return r;
|
||||
}
|
||||
|
||||
if (!get_mount_parameters_fragment(m))
|
||||
return -ENOENT;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2475,7 +2484,9 @@ const UnitVTable mount_vtable = {
|
||||
|
||||
.start = mount_start,
|
||||
.stop = mount_stop,
|
||||
|
||||
.reload = mount_reload,
|
||||
.can_reload = mount_can_reload,
|
||||
|
||||
.clean = mount_clean,
|
||||
.can_clean = mount_can_clean,
|
||||
|
||||
Reference in New Issue
Block a user