- if (nfs_name_to_address(*hostname, AF_UNSPEC, 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_mount_proto_family(options, &family))
+ return 0;
+ if (!nfs_lookup(*hostname, family, sap, &salen))
+ /* nfs_lookup 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;