X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fautomount.c;h=32680461c24612d61ebe15c71a0d6a2169050d66;hb=9a6bca7aada334cdcf10ae8e526de1f7f581da4f;hp=465354f5556503f82f790c8b0f69c973ca1d1a04;hpb=e99e38bbdcca3fe5956823bdb3d38544ccf93221;p=elogind.git diff --git a/src/automount.c b/src/automount.c index 465354f55..32680461c 100644 --- a/src/automount.c +++ b/src/automount.c @@ -59,6 +59,8 @@ static void repeat_unmout(const char *path) { assert(path); for (;;) { + /* If there are multiple mounts on a mount point, this + * removes them all */ if (umount2(path, MNT_DETACH) >= 0) continue; @@ -118,6 +120,9 @@ int automount_add_one_mount_link(Automount *a, Mount *m) { if (!path_startswith(a->where, m->where)) return 0; + if (path_equal(a->where, m->where)) + return 0; + if ((r = unit_add_dependency(UNIT(m), UNIT_BEFORE, UNIT(a), true)) < 0) return r;