diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2007-08-08 18:22:01 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2007-08-08 18:22:01 +0000 |
commit | 0042f8cc82e98b51defcf28b8e84f47f443cb55a (patch) | |
tree | 46c4e37a048d1a67ff9516befda5fdbfda8de7ba /lib/mount_util.c | |
parent | 66455c648efb5325c3d1d9691d3b8b255a4cf6a7 (diff) | |
download | fuse-0042f8cc82e98b51defcf28b8e84f47f443cb55a.tar.gz |
fixes
Diffstat (limited to 'lib/mount_util.c')
-rw-r--r-- | lib/mount_util.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/mount_util.c b/lib/mount_util.c index 55b5f4e..781a16a 100644 --- a/lib/mount_util.c +++ b/lib/mount_util.c @@ -18,14 +18,19 @@ #include <sys/stat.h> #include <sys/wait.h> -static int mtab_is_symlink(void) +static int mtab_needs_update(const char *mnt) { struct stat stbuf; + /* If mtab is within new mount, don't touch it */ + if (strncmp(mnt, _PATH_MOUNTED, strlen(mnt)) == 0 && + _PATH_MOUNTED[strlen(mnt)] == '/') + return 0; + if (lstat(_PATH_MOUNTED, &stbuf) != -1 && S_ISLNK(stbuf.st_mode)) - return 1; - else return 0; + + return 1; } int fuse_mnt_add_mount(const char *progname, const char *fsname, @@ -34,7 +39,7 @@ int fuse_mnt_add_mount(const char *progname, const char *fsname, int res; int status; - if (mtab_is_symlink()) + if (!mtab_needs_update(mnt)) return 0; res = fork(); @@ -86,7 +91,7 @@ int fuse_mnt_umount(const char *progname, const char *mnt, int lazy) int res; int status; - if (mtab_is_symlink()) + if (!mtab_needs_update(mnt)) return 0; res = fork(); |