X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fmount.c;h=66ef0cd25c3714bee713c738d7bda7483c46b511;hp=fc981c74f430dc957ef8ef14578a2f0e3f5ee9b5;hb=67445f4e22ad924394acdd4fd49e6f238244a5ca;hpb=96342de68d0d6de71a062d984dafd2a0905ed9fe diff --git a/src/core/mount.c b/src/core/mount.c index fc981c74f..66ef0cd25 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -362,7 +362,7 @@ static int mount_add_device_links(Mount *m) { if (p->passno > 0 && !mount_is_bind(p) && !path_equal(m->where, "/") && - UNIT(m)->manager->running_as == MANAGER_SYSTEM) { + UNIT(m)->manager->running_as == SYSTEMD_SYSTEM) { char *name; Unit *fsck; /* Let's add in the fsck service */ @@ -396,7 +396,7 @@ static int mount_add_quota_links(Mount *m) { assert(m); - if (UNIT(m)->manager->running_as != MANAGER_SYSTEM) + if (UNIT(m)->manager->running_as != SYSTEMD_SYSTEM) return 0; p = get_mount_parameters_fragment(m); @@ -424,7 +424,7 @@ static int mount_add_default_dependencies(Mount *m) { assert(m); - if (UNIT(m)->manager->running_as != MANAGER_SYSTEM) + if (UNIT(m)->manager->running_as != SYSTEMD_SYSTEM) return 0; p = get_mount_parameters_fragment(m); @@ -959,6 +959,9 @@ static void mount_enter_mounting(Mount *m) { mkdir_p_label(m->where, m->directory_mode); + if (dir_is_empty(m->where) <= 0) + log_notice("%s: Directory %s to mount over is not empty, ignoring. (To see the over-mounted files, please manually mount the underlying file system to a secondary location.)", m->meta.id, m->where); + /* Create the source directory for bind-mounts if needed */ p = get_mount_parameters_fragment(m); if (p && mount_is_bind(p)) @@ -981,7 +984,8 @@ static void mount_enter_mounting(Mount *m) { mount_unwatch_control_pid(m); - if ((r = mount_spawn(m, m->control_command, &m->control_pid)) < 0) + r = mount_spawn(m, m->control_command, &m->control_pid); + if (r < 0) goto fail; mount_set_state(m, MOUNT_MOUNTING); @@ -1797,6 +1801,8 @@ DEFINE_STRING_TABLE_LOOKUP(mount_result, MountResult); const UnitVTable mount_vtable = { .object_size = sizeof(Mount), + .exec_context_offset = offsetof(Mount, exec_context), + .sections = "Unit\0" "Mount\0"