]> git.saurik.com Git - apple/libinfo.git/blobdiff - rpc.subproj/rpc_prot.c
Libinfo-459.40.1.tar.gz
[apple/libinfo.git] / rpc.subproj / rpc_prot.c
index ab74c4b526849cf19ff557a817e730c21f32d401..df402b953a81558548ce21dd85bf024aaba64af4 100644 (file)
@@ -52,7 +52,7 @@
 
 #if defined(LIBC_SCCS) && !defined(lint)
 /*static char *sccsid = "from: @(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";*/
-static char *rcsid = "$Id: rpc_prot.c,v 1.2 1999/10/14 21:56:54 wsanchez Exp $";
+static char *rcsid = "$Id: rpc_prot.c,v 1.3 2003/06/23 17:24:59 majka Exp $";
 #endif
 
 /*
@@ -125,12 +125,13 @@ xdr_accepted_reply(xdrs, ar)
        switch (ar->ar_stat) {
 
        case SUCCESS:
-               return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where));
+               return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where, 0));
 
        case PROG_MISMATCH:
                if (! xdr_u_long(xdrs, &(ar->ar_vers.low)))
                        return (FALSE);
                return (xdr_u_long(xdrs, &(ar->ar_vers.high)));
+       default: break;
        }
        return (TRUE);  /* TRUE => open ended set of problems */
 }
@@ -161,8 +162,8 @@ xdr_rejected_reply(xdrs, rr)
 }
 
 static struct xdr_discrim reply_dscrm[3] = {
-       { (int)MSG_ACCEPTED, xdr_accepted_reply },
-       { (int)MSG_DENIED, xdr_rejected_reply },
+       { (int)MSG_ACCEPTED, (xdrproc_t)xdr_accepted_reply },
+       { (int)MSG_DENIED, (xdrproc_t)xdr_rejected_reply },
        { __dontcare__, NULL_xdrproc_t } };
 
 /*
@@ -242,8 +243,13 @@ accepted(acpt_stat, error)
        }
        /* something's wrong, but we don't know what ... */
        error->re_status = RPC_FAILED;
+#ifdef __LP64__
+       error->re_lb.s1 = (int)MSG_ACCEPTED;
+       error->re_lb.s2 = (int)acpt_stat;
+#else
        error->re_lb.s1 = (long)MSG_ACCEPTED;
        error->re_lb.s2 = (long)acpt_stat;
+#endif
 }
 
 static void 
@@ -254,18 +260,24 @@ rejected(rjct_stat, error)
 
        switch (rjct_stat) {
 
-       case RPC_VERSMISMATCH:
+       case RPC_MISMATCH:
                error->re_status = RPC_VERSMISMATCH;
                return;
 
        case AUTH_ERROR:
                error->re_status = RPC_AUTHERROR;
                return;
+       default: break;
        }
        /* something's wrong, but we don't know what ... */
        error->re_status = RPC_FAILED;
+#ifdef __LP64__
+       error->re_lb.s1 = (int)MSG_DENIED;
+       error->re_lb.s2 = (int)rjct_stat;
+#else
        error->re_lb.s1 = (long)MSG_DENIED;
        error->re_lb.s2 = (long)rjct_stat;
+#endif
 }
 
 /*
@@ -294,7 +306,11 @@ _seterr_reply(msg, error)
 
        default:
                error->re_status = RPC_FAILED;
+#ifdef __LP64__
+               error->re_lb.s1 = (int)(msg->rm_reply.rp_stat);
+#else
                error->re_lb.s1 = (long)(msg->rm_reply.rp_stat);
+#endif
                break;
        }
        switch (error->re_status) {
@@ -312,5 +328,7 @@ _seterr_reply(msg, error)
                error->re_vers.low = msg->acpted_rply.ar_vers.low;
                error->re_vers.high = msg->acpted_rply.ar_vers.high;
                break;
+
+       default: break;
        }
 }