Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/rpc don't lose the RPC error from CLNT_CALL.



details:   https://anonhg.NetBSD.org/src/rev/832156b4d41a
branches:  trunk
changeset: 325662:832156b4d41a
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 02 20:12:23 2014 +0000

description:
don't lose the RPC error from CLNT_CALL.

diffstat:

 lib/libc/rpc/rpcb_clnt.c |  28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diffs (73 lines):

diff -r f9824e478dee -r 832156b4d41a lib/libc/rpc/rpcb_clnt.c
--- a/lib/libc/rpc/rpcb_clnt.c  Thu Jan 02 20:02:00 2014 +0000
+++ b/lib/libc/rpc/rpcb_clnt.c  Thu Jan 02 20:12:23 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpcb_clnt.c,v 1.29 2013/03/11 20:19:29 tron Exp $      */
+/*     $NetBSD: rpcb_clnt.c,v 1.30 2014/01/02 20:12:23 christos Exp $  */
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)rpcb_clnt.c 1.30 89/06/21 Copyr 1988 Sun Micro";
 #else
-__RCSID("$NetBSD: rpcb_clnt.c,v 1.29 2013/03/11 20:19:29 tron Exp $");
+__RCSID("$NetBSD: rpcb_clnt.c,v 1.30 2014/01/02 20:12:23 christos Exp $");
 #endif
 #endif
 
@@ -578,9 +578,12 @@
        (void) snprintf(uidbuf, sizeof uidbuf, "%d", geteuid());
        parms.r_owner = uidbuf;
 
-       CLNT_CALL(client, (rpcproc_t)RPCBPROC_SET, (xdrproc_t) xdr_rpcb,
+       if (CLNT_CALL(client, (rpcproc_t)RPCBPROC_SET, (xdrproc_t) xdr_rpcb,
            (char *)(void *)&parms, (xdrproc_t) xdr_bool,
-           (char *)(void *)&rslt, tottimeout);
+           (char *)(void *)&rslt, tottimeout) != RPC_SUCCESS) {
+               rpc_createerr.cf_stat = RPC_PMAPFAILURE;
+               clnt_geterr(client, &rpc_createerr.cf_error);
+       }
 
        CLNT_DESTROY(client);
        free(parms.r_addr);
@@ -617,9 +620,12 @@
        (void) snprintf(uidbuf, sizeof uidbuf, "%d", geteuid());
        parms.r_owner = uidbuf;
 
-       CLNT_CALL(client, (rpcproc_t)RPCBPROC_UNSET, (xdrproc_t) xdr_rpcb,
+       if (CLNT_CALL(client, (rpcproc_t)RPCBPROC_UNSET, (xdrproc_t) xdr_rpcb,
            (char *)(void *)&parms, (xdrproc_t) xdr_bool,
-           (char *)(void *)&rslt, tottimeout);
+           (char *)(void *)&rslt, tottimeout) != RPC_SUCCESS) {
+               rpc_createerr.cf_stat = RPC_PMAPFAILURE;
+               clnt_geterr(client, &rpc_createerr.cf_error);
+       }
 
        CLNT_DESTROY(client);
        return (rslt);
@@ -1218,9 +1224,13 @@
                return (NULL);
        }
 
-       CLNT_CALL(client, (rpcproc_t)RPCBPROC_TADDR2UADDR,
+       if (CLNT_CALL(client, (rpcproc_t)RPCBPROC_TADDR2UADDR,
            (xdrproc_t) xdr_netbuf, (char *)(void *)taddr,
-           (xdrproc_t) xdr_wrapstring, (char *)(void *)&uaddr, tottimeout);
+           (xdrproc_t) xdr_wrapstring, (char *)(void *)&uaddr, tottimeout) 
+           != RPC_SUCCESS) {
+               rpc_createerr.cf_stat = RPC_PMAPFAILURE;
+               clnt_geterr(client, &rpc_createerr.cf_error);
+       }
        CLNT_DESTROY(client);
        return (uaddr);
 }
@@ -1259,6 +1269,8 @@
            (xdrproc_t) xdr_wrapstring, (char *)(void *)&uaddr,
            (xdrproc_t) xdr_netbuf, (char *)(void *)taddr,
            tottimeout) != RPC_SUCCESS) {
+               rpc_createerr.cf_stat = RPC_PMAPFAILURE;
+               clnt_geterr(client, &rpc_createerr.cf_error);
                free(taddr);
                taddr = NULL;
        }



Home | Main Index | Thread Index | Old Index