fix
authorMiklos Szeredi <miklos@szeredi.hu>
Wed, 22 Oct 2003 11:11:57 +0000 (11:11 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Wed, 22 Oct 2003 11:11:57 +0000 (11:11 +0000)
ChangeLog
Filesystems
include/fuse.h
util/fusermount.c

index 78180c3efb63ec0cf4602fbc75fb76b21f6248e9..7968b9151b0689d351772768109a75a1af037279 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 347e1f77a734b20f12aa1684b30409e10fa821e8..dc4fbd444e8a34ad39caf66b0e25f8026f1c46d4 100644 (file)
@@ -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:
 
index b54cb47b5b697fb03a4be003cf5c4b226420de3b..719564e41b394f795bdf69fdfdf82586d5793ec5 100644 (file)
@@ -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:
index 0f94c7e4799da07ab8b63e7dbe260e3e6166ce95..f223c5f5668b217064ec2357ccbb645e99a55362 100644 (file)
@@ -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);