X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmount.c;h=7e3ccc11b60618bc7f6a18ddb39a2c2e48a6a637;hb=a99124d92f8a60215f5ea5ed95de9792c1fb3324;hp=5709db2266196c1a9e82ce25f35ae18bdb9a1598;hpb=c74f17d96cccd4cc998fd037cb92046930188c91;p=elogind.git diff --git a/src/core/mount.c b/src/core/mount.c index 5709db226..7e3ccc11b 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); @@ -634,7 +634,7 @@ static int mount_load(Unit *u) { if (r < 0) return r; - r = unit_patch_working_directory(UNIT(m), &m->exec_context); + r = unit_exec_context_defaults(u, &m->exec_context); if (r < 0) return r; } @@ -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, mounting anyway. (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); @@ -1225,7 +1229,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { m->control_pid = 0; - if (is_clean_exit(code, status)) + if (is_clean_exit(code, status, NULL)) f = MOUNT_SUCCESS; else if (code == CLD_EXITED) f = MOUNT_FAILURE_EXIT_CODE; @@ -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"