From 0b47f6bc8bfe939f12266ef41cba31a2eb2c5f30 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 12 Nov 2007 13:57:12 +0000 Subject: 'fusermount -u' did not umount the filesystem if /etc/mtab was a symlink --- lib/mount_util.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/mount_util.c b/lib/mount_util.c index c7b2123..9ce431a 100644 --- a/lib/mount_util.c +++ b/lib/mount_util.c @@ -17,6 +17,7 @@ #include #include #include +#include static int mtab_needs_update(const char *mnt) { @@ -91,8 +92,13 @@ int fuse_mnt_umount(const char *progname, const char *mnt, int lazy) int res; int status; - if (!mtab_needs_update(mnt)) - return 0; + if (!mtab_needs_update(mnt)) { + res = umount2(mnt, lazy ? 2 : 0); + if (res == -1) + fprintf(stderr, "%s: failed to unmount %s: %s\n", progname, + mnt, strerror(errno)); + return res; + } res = fork(); if (res == -1) { -- cgit v1.2.3