CLIENT *client;
enum clnt_stat res = 0;
- if (nfs_probe_mntport(sap, salen, &mnt_pmap) == 0)
- return 0;
-
memcpy(saddr, sap, salen);
+ if (nfs_probe_mntport(saddr, salen, &mnt_pmap) == 0) {
+ if (verbose)
+ nfs_error(_("%s: Failed to discover mountd port%s"),
+ progname, clnt_spcreateerror(""));
+ return 0;
+ }
nfs_set_port(saddr, mnt_pmap.pm_port);
client = nfs_get_priv_rpcclient(saddr, salen, mnt_pmap.pm_prot,
mnt_pmap.pm_prog, mnt_pmap.pm_vers,
&timeout);
- if (client == NULL)
+ if (client == NULL) {
+ if (verbose)
+ nfs_error(_("%s: Failed to create RPC client%s"),
+ progname, clnt_spcreateerror(""));
return 0;
+ }
client->cl_auth = authunix_create_default();
(xdrproc_t)xdr_dirpath, (caddr_t)argp,
(xdrproc_t)xdr_void, NULL,
timeout);
+ if (verbose && res != RPC_SUCCESS)
+ nfs_error(_("%s: UMNT call failed: %s"),
+ progname, clnt_sperrno(res));
auth_destroy(client->cl_auth);
CLNT_DESTROY(client);
if (res != RPC_SUCCESS)
return 0;
-
return 1;
}
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;
}
/*