+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
Author: Paul H. Alfille <palfille at partners org>
-Homepage: http://home.earthlink.net/~palfille/ow.html
+Homepage: http://owfs.sourceforge.net
Description:
/** 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:
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) {
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);