]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/mount.c
Handle -o remount better
[nfs-utils.git] / utils / mount / mount.c
index 45428b0c0662cc60400b5935d8d7cb0c1604bdb5..4da900240e249eda79c54de0291ea42c11c5d1ab 100644 (file)
@@ -179,6 +179,11 @@ int add_mtab(char *fsname, char *mount_point, char *fstype, int flags, char *opt
        ment.mnt_freq = 0;
        ment.mnt_passno= 0;
 
+       if(flags & MS_REMOUNT) {
+               update_mtab(ment.mnt_dir, &ment);
+               return 0;
+       }
+
        lock_mtab();
 
         if ((mtab = setmntent(MOUNTED, "a+")) == NULL) {
@@ -443,18 +448,18 @@ int main(int argc, char *argv[])
                        start_statd();
        }
 
-       if (fake)
-               return 0;
        if (mnt_err)
                exit(EX_FAIL);
 
-       mnt_err = do_mount_syscall(spec, mount_point,
-                                  nfs_mount_vers == 4 ? "nfs4" : "nfs",
-                                  flags, mount_opts);
-               
-       if (mnt_err) {
-               mount_error(mount_point);
-               exit(EX_FAIL);
+       if (!fake) {
+               mnt_err = do_mount_syscall(spec, mount_point,
+                                          nfs_mount_vers == 4 ? "nfs4" : "nfs",
+                                          flags, mount_opts);
+
+               if (mnt_err) {
+                       mount_error(mount_point);
+                       exit(EX_FAIL);
+               }
        }
 
        if (!nomtab)