Source-Changes-HG archive

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

[src/trunk]: src/tests/lib/libc/rpc skip if we are not running rpcbind.



details:   https://anonhg.NetBSD.org/src/rev/5e69e001a309
branches:  trunk
changeset: 347484:5e69e001a309
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Aug 27 14:36:22 2016 +0000

description:
skip if we are not running rpcbind.

diffstat:

 tests/lib/libc/rpc/t_rpc.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (79 lines):

diff -r 734a02f7e7cd -r 5e69e001a309 tests/lib/libc/rpc/t_rpc.c
--- a/tests/lib/libc/rpc/t_rpc.c        Sat Aug 27 14:23:54 2016 +0000
+++ b/tests/lib/libc/rpc/t_rpc.c        Sat Aug 27 14:36:22 2016 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: t_rpc.c,v 1.9 2015/11/27 13:59:40 christos Exp $       */
+/*     $NetBSD: t_rpc.c,v 1.10 2016/08/27 14:36:22 christos Exp $      */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_rpc.c,v 1.9 2015/11/27 13:59:40 christos Exp $");
+__RCSID("$NetBSD: t_rpc.c,v 1.10 2016/08/27 14:36:22 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -21,12 +21,12 @@
 
 #define SKIPX(ev, msg, ...)    do {                    \
        atf_tc_skip(msg, __VA_ARGS__);                  \
-       return;                                         \
+       return ev;                                      \
 } while(/*CONSTCOND*/0)
 
 #else
-#define ERRX(ev, msg, ...)     errx(ev, msg, __VA_ARGS__)
-#define SKIPX(ev, msg, ...)    errx(ev, msg, __VA_ARGS__)
+#define ERRX(ev, msg, ...)     errx(EXIT_FAILURE, msg, __VA_ARGS__)
+#define SKIPX(ev, msg, ...)    errx(EXIT_FAILURE, msg, __VA_ARGS__)
 #endif
 
 #ifdef DEBUG
@@ -72,13 +72,13 @@
        __rpc_control(CLCR_SET_RPCB_TIMEOUT, &tv);
 
        if ((clnt = clnt_create(host, RPCBPROG, RPCBVERS, transp)) == NULL)
-               SKIPX(EXIT_FAILURE, "clnt_create (%s)", clnt_spcreateerror(""));
+               SKIPX(, "clnt_create (%s)", clnt_spcreateerror(""));
 
        tv.tv_sec = 1;
        tv.tv_usec = 0;
        if (clnt_call(clnt, RPCBPROC_NULL, xdr_void, NULL, xdr_void, NULL, tv)
            != RPC_SUCCESS)
-               ERRX(EXIT_FAILURE, "clnt_call (%s)", clnt_sperror(clnt, ""));
+               ERRX(, "clnt_call (%s)", clnt_sperror(clnt, ""));
        clnt_control(clnt, CLGET_SVC_ADDR, (char *) &addr);
        reply(NULL, &addr, NULL);
 }
@@ -100,13 +100,13 @@
        switch (rqstp->rq_proc) {
        case NULLPROC:
                if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
-                       ERRX(EXIT_FAILURE, "svc_sendreply failed %d", 0);
+                       ERRX(, "svc_sendreply failed %d", 0);
                return;
        case PLUSONE:
                break;
        case DESTROY:
                if (!svc_sendreply(transp, (xdrproc_t)xdr_void, NULL))
-                       ERRX(EXIT_FAILURE, "svc_sendreply failed %d", 0);
+                       ERRX(, "svc_sendreply failed %d", 0);
                svc_destroy(transp);
                exit(0);
        default:
@@ -121,7 +121,7 @@
        DPRINTF("About to increment\n");
        num++;
        if (!svc_sendreply(transp, (xdrproc_t)xdr_int, (void *)&num))
-               ERRX(EXIT_FAILURE, "svc_sendreply failed %d", 1);
+               ERRX(, "svc_sendreply failed %d", 1);
        DPRINTF("Leaving server procedure.\n");
 }
 
@@ -176,7 +176,7 @@
 
        svc_fdset_init(p ? SVC_FDSET_POLL : 0);
        if (!svc_create(server, PROGNUM, VERSNUM, transp))
-               ERRX(EXIT_FAILURE, "Cannot create server %d", num);
+               SKIPX(EXIT_FAILURE, "Cannot create server %d", num);
 
        switch ((pid = fork())) {
        case 0:



Home | Main Index | Thread Index | Old Index