]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/nfsumount.c
Remove nfs_mntent_t in favour of struct mntent
[nfs-utils.git] / utils / mount / nfsumount.c
index 077219d6ae87e223669492c642e55bfc9d481b5e..eb3d1fb5ae714da80ec01c026d085f3672fbb067 100644 (file)
@@ -147,7 +147,7 @@ int del_mtab(const char *spec, const char *node)
                 res = mount(spec, node, NULL,
                             MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
                 if (res == 0) {
-                        nfs_mntent_t remnt;
+                        struct mntent remnt;
                         fprintf(stderr,
                                 _("umount: %s busy - remounted read-only\n"),
                                 spec);
@@ -324,16 +324,17 @@ int nfsumount(int argc, char *argv[])
        if (!mc && verbose)
                printf(_("Could not find %s in mtab\n"), spec);
 
+       ret = 0;
        if (mc) {
-               ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
+               if (!lazy)
+                       ret = _nfsumount(mc->m.mnt_fsname, mc->m.mnt_opts);
                if(ret)
                        ret = del_mtab(mc->m.mnt_fsname, mc->m.mnt_dir);
-       } else {
-               if (*spec != '/')
+       } else if (*spec != '/') {
+               if (!lazy)
                        ret = _nfsumount(spec, "tcp,v3");
-               else
-                       ret = del_mtab(NULL, spec);
-       }
+       } else
+               ret = del_mtab(NULL, spec);
 
        return(ret);
 }