X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fmount.c;h=aae9d982ae2e478ebd565a8e2bb7e47305e5f7aa;hb=e0fa621b8b52da4d95bf5918eb998c9166e4bc7c;hp=f978a5467d2f542e76046f7292ecafa8168585b0;hpb=9a57c62944258c750d80bca4fe56de4dbab46d67;p=elogind.git diff --git a/src/mount.c b/src/mount.c index f978a5467..aae9d982a 100644 --- a/src/mount.c +++ b/src/mount.c @@ -98,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);