X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmount.c;h=d9f3da6c48e3c5d9621b31a3c338871192db431d;hb=7fc01d33196f329c24766795b7af66e598c3e65b;hp=08e99141b12f3abd59db826a9d5be40dcce1e849;hpb=e2f3b44cfc8864bfea7c77ff4c383ce9b535f27e;p=elogind.git diff --git a/src/mount.c b/src/mount.c index 08e99141b..d9f3da6c4 100644 --- a/src/mount.c +++ b/src/mount.c @@ -36,6 +36,7 @@ #include "dbus-mount.h" #include "special.h" #include "bus-errors.h" +#include "exit-status.h" static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = { [MOUNT_DEAD] = UNIT_INACTIVE, @@ -97,12 +98,21 @@ static void mount_parameters_done(MountParameters *p) { static void mount_done(Unit *u) { Mount *m = MOUNT(u); + Meta *other; assert(m); free(m->where); m->where = NULL; + /* Try to detach us from the automount unit if there is any */ + LIST_FOREACH(units_per_type, other, m->meta.manager->units_per_type[UNIT_AUTOMOUNT]) { + Automount *a = (Automount*) other; + + if (a->mount == m) + a->mount = NULL; + } + mount_parameters_done(&m->parameters_etc_fstab); mount_parameters_done(&m->parameters_proc_self_mountinfo); mount_parameters_done(&m->parameters_fragment); @@ -362,6 +372,7 @@ static int mount_add_device_links(Mount *m) { } if (p->passno > 0 && + !mount_is_bind(p) && UNIT(m)->meta.manager->running_as == MANAGER_SYSTEM && !path_equal(m->where, "/")) { char *name;