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 /support | |
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 'support')
-rw-r--r-- | support/nfs/getport.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/support/nfs/getport.c b/support/nfs/getport.c index 4d4b1c4..4bdf556 100644 --- a/support/nfs/getport.c +++ b/support/nfs/getport.c @@ -398,6 +398,10 @@ static int nfs_gp_ping(CLIENT *client, struct timeval timeout) (xdrproc_t)xdr_void, NULL, timeout); + if (status != RPC_SUCCESS) { + rpc_createerr.cf_stat = status; + CLNT_GETERR(client, &rpc_createerr.cf_error); + } return (int)(status == RPC_SUCCESS); } @@ -530,7 +534,7 @@ static unsigned long nfs_gp_pmap_getport(CLIENT *client, if (status != RPC_SUCCESS) { rpc_createerr.cf_stat = status; - clnt_geterr(client, &rpc_createerr.cf_error); + CLNT_GETERR(client, &rpc_createerr.cf_error); port = 0; } else if (port == 0) rpc_createerr.cf_stat = RPC_PROGNOTREGISTERED; |