diff options
author | Steve Dickson <steved@redhat.com> | 2009-07-15 07:58:22 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-07-15 07:58:22 -0400 |
commit | 3339c1f73c05fc9b5cf51e14a2033ec38f671334 (patch) | |
tree | 32cf87800fdd14d63495611c490facc5e48a1ae4 /utils/mount/network.c | |
parent | b46dc42505da799a05a3a5e8f004b308f6b9eef7 (diff) | |
download | nfs-utils-3339c1f73c05fc9b5cf51e14a2033ec38f671334.tar.gz nfs-utils-3339c1f73c05fc9b5cf51e14a2033ec38f671334.tar.xz nfs-utils-3339c1f73c05fc9b5cf51e14a2033ec38f671334.zip |
errno not be set on RPC errors
Changed both nfs_advise_umount() and nfs_gp_ping() to
set the errno by calling CLNT_GETERR() after a CLNT_CALL()
error. Also added code to rpc_strerror() that will log
the errno value, when set, via strerror().
These changes added essential information to the error message
making it much easier to detect errorsuch as "Connection refused"
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r-- | utils/mount/network.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c index 4ec7c7b..f6fa5fd 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -848,10 +848,14 @@ int nfs_advise_umount(const struct sockaddr *sap, const socklen_t salen, (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)); + if (res != RPC_SUCCESS) { + rpc_createerr.cf_stat = res; + CLNT_GETERR(client, &rpc_createerr.cf_error); + if (verbose) + nfs_error(_("%s: UMNT call failed: %s"), + progname, clnt_sperrno(res)); + } auth_destroy(client->cl_auth); CLNT_DESTROY(client); |