]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/nfsumount.c
umount.nfs: Harden umount.nfs error reporting
[nfs-utils.git] / utils / mount / nfsumount.c
index 4b2e53054b83ed515ae5990e88a584d364e2d117..9b48cc9a63239d9c92eb89edf31cdfd56476ae72 100644 (file)
@@ -182,14 +182,15 @@ static int nfs_umount_do_umnt(struct mount_options *options,
                return EX_FAIL;
        }
 
-       if (nfs_name_to_address(*hostname, sap, &salen)) {
-               if (nfs_advise_umount(sap, salen, &mnt_pmap, dirname) != 0)
-                       return EX_SUCCESS;
-               else
-                       nfs_error(_("%s: Server failed to unmount '%s:%s'"),
-                                       progname, *hostname, *dirname);
-       }
-       return EX_FAIL;
+       if (nfs_name_to_address(*hostname, sap, &salen) == 0)
+               /* nfs_name_to_address reports any errors */
+               return EX_FAIL;
+
+       if (nfs_advise_umount(sap, salen, &mnt_pmap, dirname) == 0)
+               /* nfs_advise_umount reports any errors */
+               return EX_FAIL;
+
+       return EX_SUCCESS;
 }
 
 /*