From 3339c1f73c05fc9b5cf51e14a2033ec38f671334 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Wed, 15 Jul 2009 07:58:22 -0400 Subject: 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 --- utils/mount/error.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'utils/mount/error.c') diff --git a/utils/mount/error.c b/utils/mount/error.c index 4cc9e09..1b64bd7 100644 --- a/utils/mount/error.c +++ b/utils/mount/error.c @@ -70,9 +70,15 @@ static int rpc_strerror(int spos) pos = snprintf(tmp, (erreob - tmp), _("System Error: %s"), strerror(cf_errno)); - else - pos = snprintf(tmp, (erreob - tmp), - _("RPC Error:%s"), estr); + else { + if (cf_errno) + pos = snprintf(tmp, (erreob - tmp), + _("RPC Error:%s; errno = %s"), + estr, strerror(cf_errno)); + else + pos = snprintf(tmp, (erreob - tmp), + _("RPC Error:%s"), estr); + } } return pos; } -- cgit