diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2003-10-22 11:11:57 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2003-10-22 11:11:57 +0000 |
commit | f08ace0740cf373330148b2ec1fb699996852230 (patch) | |
tree | 2a9fad15d77c2ef71af55efc68f5da02fe75fc3a | |
parent | 0e5350899c9b16ed867d12856665f008357dea79 (diff) | |
download | libfuse-f08ace0740cf373330148b2ec1fb699996852230.tar.gz |
fix
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Filesystems | 2 | ||||
-rw-r--r-- | include/fuse.h | 10 | ||||
-rw-r--r-- | util/fusermount.c | 19 |
4 files changed, 24 insertions, 12 deletions
@@ -1,3 +1,8 @@ +2003-10-22 Miklos Szeredi <mszeredi@inf.bme.hu> + + * Mtab handling fix in fusermount by "Valient Gough" (SF patch + #766443) + 2003-10-13 Miklos Szeredi <mszeredi@inf.bme.hu> * Error code fixes in kernel module diff --git a/Filesystems b/Filesystems index 347e1f7..dc4fbd4 100644 --- a/Filesystems +++ b/Filesystems @@ -2,7 +2,7 @@ Name: OW Author: Paul H. Alfille <palfille at partners org> -Homepage: http://home.earthlink.net/~palfille/ow.html +Homepage: http://owfs.sourceforge.net Description: diff --git a/include/fuse.h b/include/fuse.h index b54cb47..719564e 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -38,8 +38,14 @@ struct fuse_statfs { /** Handle for a getdir() operation */ typedef struct fuse_dirhandle *fuse_dirh_t; -/** Function to add an entry in a getdir() operation */ -typedef int (*fuse_dirfil_t) (fuse_dirh_t, const char *, int type); +/** Function to add an entry in a getdir() operation + * + * @param h the handle passed to the getdir() operation + * @param name the file name of the directory entry + * @param type the file type (0 if unknown) see <dirent.h> + * @return 0 on success, -errno on error + */ +typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type); /** * The file system operations: diff --git a/util/fusermount.c b/util/fusermount.c index 0f94c7e..f223c5f 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -150,16 +150,8 @@ static int remove_mount(const char *mnt) remove = 1; } } - if(remove) { - res = umount2(mnt, 2); /* Lazy umount */ - if(res == -1) { - fprintf(stderr, "%s: failed to unmount %s: %s\n", progname, - mnt, strerror(errno)); - found = -1; - break; - } + if(remove) found = 1; - } else { res = addmntent(newfp, entp); if(res != 0) { @@ -172,6 +164,15 @@ static int remove_mount(const char *mnt) endmntent(fp); endmntent(newfp); + + if(found) { + res = umount2(mnt, 2); /* Lazy umount */ + if(res == -1) { + fprintf(stderr, "%s: failed to unmount %s: %s\n", progname, mnt, + strerror(errno)); + found = -1; + } + } if(found == 1) { res = rename(mtab_new, mtab); |