Module Name:    src
Committed By:   christos
Date:           Mon Mar  4 17:17:57 UTC 2013

Modified Files:
        src/lib/libc/rpc: auth_unix.c clnt_raw.c svc_generic.c svc_simple.c
            svc_vc.c xdr.c xdr_array.c xdr_rec.c xdr_reference.c

Log Message:
fix error messages and warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/rpc/auth_unix.c
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/rpc/clnt_raw.c
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/rpc/svc_generic.c
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/rpc/svc_simple.c \
    src/lib/libc/rpc/xdr.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/rpc/svc_vc.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/rpc/xdr_array.c
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/rpc/xdr_rec.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/rpc/xdr_reference.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/rpc/auth_unix.c
diff -u src/lib/libc/rpc/auth_unix.c:1.23 src/lib/libc/rpc/auth_unix.c:1.24
--- src/lib/libc/rpc/auth_unix.c:1.23	Tue Mar 20 13:14:50 2012
+++ src/lib/libc/rpc/auth_unix.c	Mon Mar  4 12:17:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth_unix.c,v 1.23 2012/03/20 17:14:50 matt Exp $	*/
+/*	$NetBSD: auth_unix.c,v 1.24 2013/03/04 17:17:56 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)auth_unix.c 1.19 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)auth_unix.c	2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: auth_unix.c,v 1.23 2012/03/20 17:14:50 matt Exp $");
+__RCSID("$NetBSD: auth_unix.c,v 1.24 2013/03/04 17:17:56 christos Exp $");
 #endif
 #endif
 
@@ -115,14 +115,14 @@ authunix_create(char *machname, int uid,
 	auth = mem_alloc(sizeof(*auth));
 #ifndef KERNEL
 	if (auth == NULL) {
-		warnx("authunix_create: out of memory");
+		warn("%s: out of memory", __func__);
 		goto cleanup_authunix_create;
 	}
 #endif
 	au = mem_alloc(sizeof(*au));
 #ifndef KERNEL
 	if (au == NULL) {
-		warnx("authunix_create: out of memory");
+		warn("%s: out of memory", __func__);
 		goto cleanup_authunix_create;
 	}
 #endif
@@ -155,7 +155,7 @@ authunix_create(char *machname, int uid,
 	au->au_origcred.oa_base = mem_alloc((size_t)len);
 #else
 	if ((au->au_origcred.oa_base = mem_alloc((size_t)len)) == NULL) {
-		warnx("authunix_create: out of memory");
+		warn("%s: out of memory", __func__);
 		goto cleanup_authunix_create;
 	}
 #endif
@@ -342,7 +342,7 @@ marshal_new_auth(AUTH *auth)
 	xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE);
 	if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) ||
 	    (! xdr_opaque_auth(xdrs, &(auth->ah_verf))))
-		warnx("auth_none.c - Fatal marshalling problem");
+		warnx("%s: Fatal marshalling problem", __func__);
 	else
 		au->au_mpos = XDR_GETPOS(xdrs);
 	XDR_DESTROY(xdrs);

Index: src/lib/libc/rpc/clnt_raw.c
diff -u src/lib/libc/rpc/clnt_raw.c:1.30 src/lib/libc/rpc/clnt_raw.c:1.31
--- src/lib/libc/rpc/clnt_raw.c:1.30	Tue Mar 20 13:14:50 2012
+++ src/lib/libc/rpc/clnt_raw.c	Mon Mar  4 12:17:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: clnt_raw.c,v 1.30 2012/03/20 17:14:50 matt Exp $	*/
+/*	$NetBSD: clnt_raw.c,v 1.31 2013/03/04 17:17:56 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)clnt_raw.c 1.22 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)clnt_raw.c	2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: clnt_raw.c,v 1.30 2012/03/20 17:14:50 matt Exp $");
+__RCSID("$NetBSD: clnt_raw.c,v 1.31 2013/03/04 17:17:56 christos Exp $");
 #endif
 #endif
 
@@ -128,7 +128,7 @@ clnt_raw_create(rpcprog_t prog, rpcvers_
 	call_msg.rm_call.cb_vers = (u_int32_t)vers;
 	xdrmem_create(xdrs, clp->u.mashl_callmsg, MCALL_MSG_SIZE, XDR_ENCODE); 
 	if (! xdr_callhdr(xdrs, &call_msg))
-		warnx("clntraw_create - Fatal header serialization error.");
+		warnx("%s: Fatal header serialization error", __func__);
 	clp->mcnt = XDR_GETPOS(xdrs);
 	XDR_DESTROY(xdrs);
 

Index: src/lib/libc/rpc/svc_generic.c
diff -u src/lib/libc/rpc/svc_generic.c:1.12 src/lib/libc/rpc/svc_generic.c:1.13
--- src/lib/libc/rpc/svc_generic.c:1.12	Tue Mar 20 13:14:50 2012
+++ src/lib/libc/rpc/svc_generic.c	Mon Mar  4 12:17:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc_generic.c,v 1.12 2012/03/20 17:14:50 matt Exp $	*/
+/*	$NetBSD: svc_generic.c,v 1.13 2013/03/04 17:17:56 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)svc_generic.c 1.21 89/02/28 Copyr 1988 Sun Micro";
 #else
-__RCSID("$NetBSD: svc_generic.c,v 1.12 2012/03/20 17:14:50 matt Exp $");
+__RCSID("$NetBSD: svc_generic.c,v 1.13 2013/03/04 17:17:56 christos Exp $");
 #endif
 #endif
 
@@ -105,7 +105,7 @@ svc_create(
 /* VARIABLES PROTECTED BY xprtlist_lock: xprtlist */
 
 	if ((handle = __rpc_setconf(nettype)) == NULL) {
-		warnx("svc_create: unknown protocol");
+		warnx("%s: unknown protocol %s", __func__, nettype);
 		return (0);
 	}
 	while ((nconf = __rpc_getconf(handle)) != NULL) {
@@ -116,10 +116,10 @@ svc_create(
 				(void) rpcb_unset(prognum, versnum, nconf);
 				if (svc_reg(l->xprt, prognum, versnum,
 					dispatch, nconf) == FALSE)
-					warnx(
-		"svc_create: could not register prog %u vers %u on %s",
-					(unsigned)prognum, (unsigned)versnum,
-					 nconf->nc_netid);
+					warnx("%s: could not register prog %u "
+					    "vers %u on %s", __func__,
+					    (unsigned)prognum,
+					    (unsigned)versnum, nconf->nc_netid);
 				else
 					num++;
 				break;
@@ -131,7 +131,7 @@ svc_create(
 			if (xprt) {
 				l = malloc(sizeof(*l));
 				if (l == NULL) {
-					warnx("svc_create: no memory");
+					warn("%s: out of memory", __func__);
 					mutex_unlock(&xprtlist_lock);
 					return (0);
 				}
@@ -166,9 +166,8 @@ svc_tp_create(
 	SVCXPRT *xprt;
 
 	if (nconf == NULL) {
-		warnx(
-	"svc_tp_create: invalid netconfig structure for prog %u vers %u",
-				(unsigned)prognum, (unsigned)versnum);
+		warnx("%s: invalid netconfig structure for prog %u vers %u",
+		    __func__, (unsigned)prognum, (unsigned)versnum);
 		return (NULL);
 	}
 	xprt = svc_tli_create(RPC_ANYFD, nconf, NULL, 0, 0);
@@ -177,10 +176,9 @@ svc_tp_create(
 	}
 	(void) rpcb_unset(prognum, versnum, __UNCONST(nconf));
 	if (svc_reg(xprt, prognum, versnum, dispatch, nconf) == FALSE) {
-		warnx(
-		"svc_tp_create: Could not register prog %u vers %u on %s",
-				(unsigned)prognum, (unsigned)versnum,
-				nconf->nc_netid);
+		warnx("%s: Could not register prog %u vers %u on %s",
+		    __func__, (unsigned)prognum, (unsigned)versnum,
+		    nconf->nc_netid);
 		SVC_DESTROY(xprt);
 		return (NULL);
 	}
@@ -212,14 +210,13 @@ svc_tli_create(
 
 	if (fd == RPC_ANYFD) {
 		if (nconf == NULL) {
-			warnx("svc_tli_create: invalid netconfig");
+			warnx("%s: invalid netconfig", __func__);
 			return (NULL);
 		}
 		fd = __rpc_nconf2fd(nconf);
 		if (fd == -1) {
-			warnx(
-			    "svc_tli_create: could not open connection for %s",
-					nconf->nc_netid);
+			warnx("%s: could not open connection for %s", __func__,
+			    nconf->nc_netid);
 			return (NULL);
 		}
 		__rpc_nconf2sockinfo(nconf, &si);
@@ -229,8 +226,8 @@ svc_tli_create(
 		 * It is an open descriptor. Get the transport info.
 		 */
 		if (!__rpc_fd2sockinfo(fd, &si)) {
-			warnx(
-		"svc_tli_create: could not get transport information");
+			warnx("%s: could not get transport information",
+			    __func__);
 			return (NULL);
 		}
 	}
@@ -246,8 +243,8 @@ svc_tli_create(
 				ss.ss_len = si.si_alen;
 				if (bind(fd, (struct sockaddr *)(void *)&ss,
 				    (socklen_t)si.si_alen) < 0) {
-					warnx(
-			"svc_tli_create: could not bind to anonymous port");
+					warn( "%s: could not bind to anonymous "
+					    "port", __func__);
 					goto freedata;
 				}
 			}
@@ -256,8 +253,8 @@ svc_tli_create(
 			if (bind(fd,
 			    (struct sockaddr *)bindaddr->addr.buf,
 			    (socklen_t)si.si_alen) < 0) {
-				warnx(
-		"svc_tli_create: could not bind to requested address");
+				warnx("%s: could not bind to requested address",
+				    __func__);
 				goto freedata;
 			}
 			listen(fd, (int)bindaddr->qlen);
@@ -268,29 +265,29 @@ svc_tli_create(
 	 * call transport specific function.
 	 */
 	switch (si.si_socktype) {
-		case SOCK_STREAM:
-			slen = sizeof ss;
-			if (getpeername(fd, (struct sockaddr *)(void *)&ss, &slen)
-			    == 0) {
-				/* accepted socket */
-				xprt = svc_fd_create(fd, sendsz, recvsz);
-			} else
-				xprt = svc_vc_create(fd, sendsz, recvsz);
-			if (!nconf || !xprt)
-				break;
+	case SOCK_STREAM:
+		slen = sizeof ss;
+		if (getpeername(fd, (struct sockaddr *)(void *)&ss, &slen)
+		    == 0) {
+			/* accepted socket */
+			xprt = svc_fd_create(fd, sendsz, recvsz);
+		} else
+			xprt = svc_vc_create(fd, sendsz, recvsz);
+		if (!nconf || !xprt)
+			break;
 #if 0
-			/* XXX fvdl */
-			if (strcmp(nconf->nc_protofmly, "inet") == 0 ||
-			    strcmp(nconf->nc_protofmly, "inet6") == 0)
-				(void) __svc_vc_setflag(xprt, TRUE);
+		/* XXX fvdl */
+		if (strcmp(nconf->nc_protofmly, "inet") == 0 ||
+		    strcmp(nconf->nc_protofmly, "inet6") == 0)
+			(void) __svc_vc_setflag(xprt, TRUE);
 #endif
-			break;
-		case SOCK_DGRAM:
-			xprt = svc_dg_create(fd, sendsz, recvsz);
-			break;
-		default:
-			warnx("svc_tli_create: bad service type");
-			goto freedata;
+		break;
+	case SOCK_DGRAM:
+		xprt = svc_dg_create(fd, sendsz, recvsz);
+		break;
+	default:
+		warnx("%s: bad service type %u", __func__, si.si_socktype);
+		goto freedata;
 	}
 
 	if (xprt == NULL)

Index: src/lib/libc/rpc/svc_simple.c
diff -u src/lib/libc/rpc/svc_simple.c:1.31 src/lib/libc/rpc/svc_simple.c:1.32
--- src/lib/libc/rpc/svc_simple.c:1.31	Tue Mar 20 13:14:50 2012
+++ src/lib/libc/rpc/svc_simple.c	Mon Mar  4 12:17:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc_simple.c,v 1.31 2012/03/20 17:14:50 matt Exp $	*/
+/*	$NetBSD: svc_simple.c,v 1.32 2013/03/04 17:17:56 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -48,7 +48,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: svc_simple.c,v 1.31 2012/03/20 17:14:50 matt Exp $");
+__RCSID("$NetBSD: svc_simple.c,v 1.32 2013/03/04 17:17:56 christos Exp $");
 #endif
 
 #include "namespace.h"
@@ -83,8 +83,6 @@ static struct proglst {
 	struct proglst *p_nxt;
 } *proglst;
 
-static const char rpc_reg_err[] = "%s: %s";
-static const char rpc_reg_msg[] = "rpc_reg: ";
 static const char __reg_err1[] = "can't find appropriate transport";
 static const char __reg_err2[] = "can't get protocol info";
 static const char __reg_err3[] = "unsupported transport size";
@@ -119,15 +117,15 @@ rpc_reg(
 #endif
 
 	if (procnum == NULLPROC) {
-		warnx("%s can't reassign procedure number %u", rpc_reg_msg,
-			NULLPROC);
+		warnx("%s: can't reassign procedure number %u", __func__,
+		    NULLPROC);
 		return (-1);
 	}
 
 	if (nettype == NULL)
 		nettype = __UNCONST("netpath");	/* The default behavior */
 	if ((handle = __rpc_setconf(nettype)) == NULL) {
-		warnx(rpc_reg_err, rpc_reg_msg, __reg_err1);
+		warnx("%s: %s", __func__, __reg_err1);
 		return (-1);
 	}
 /* VARIABLES PROTECTED BY proglst_lock: proglst */
@@ -161,19 +159,19 @@ rpc_reg(
 			if (svcxprt == NULL)
 				continue;
 			if (!__rpc_fd2sockinfo(svcxprt->xp_fd, &si)) {
-				warnx(rpc_reg_err, rpc_reg_msg, __reg_err2);
+				warnx("%s: %s", __func__, __reg_err2);
 				SVC_DESTROY(svcxprt);
 				continue;
 			}
 			recvsz = __rpc_get_t_size(si.si_af, si.si_proto, 0);
 			if (recvsz == 0) {
-				warnx(rpc_reg_err, rpc_reg_msg, __reg_err3);
+				warnx("%s: %s", __func__, __reg_err3);
 				SVC_DESTROY(svcxprt);
 				continue;
 			}
-			if (((xdrbuf = malloc((size_t)recvsz)) == NULL) ||
+			if (((xdrbuf = mem_alloc((size_t)recvsz)) == NULL) ||
 				((netid = strdup(nconf->nc_netid)) == NULL)) {
-				warnx(rpc_reg_err, rpc_reg_msg, __no_mem_str);
+				warnx("%s: %s", __func__, __no_mem_str);
 				if (xdrbuf != NULL)
 					free(xdrbuf);
 				if (netid != NULL)
@@ -200,9 +198,9 @@ rpc_reg(
 		}
 
 		if (!svc_reg(svcxprt, prognum, versnum, universal, nconf)) {
-			warnx("%s couldn't register prog %u vers %u for %s",
-				rpc_reg_msg, (unsigned)prognum,
-				(unsigned)versnum, netid);
+			warnx("%s: couldn't register prog %u vers %u for %s",
+			    __func__, (unsigned)prognum,
+			    (unsigned)versnum, netid);
 			if (madenow) {
 				SVC_DESTROY(svcxprt);
 				free(xdrbuf);
@@ -213,7 +211,7 @@ rpc_reg(
 
 		pl = malloc(sizeof(*pl));
 		if (pl == NULL) {
-			warnx(rpc_reg_err, rpc_reg_msg, __no_mem_str);
+			warn("%s: %s", __func__, __no_mem_str);
 			if (madenow) {
 				SVC_DESTROY(svcxprt);
 				free(xdrbuf);
@@ -239,8 +237,8 @@ rpc_reg(
 	mutex_unlock(&proglst_lock);
 
 	if (done == FALSE) {
-		warnx("%s cant find suitable transport for %s",
-			rpc_reg_msg, nettype);
+		warnx("%s: can't find suitable transport for %s",
+		    __func__, nettype);
 		return (-1);
 	}
 	return (0);
@@ -273,7 +271,7 @@ universal(struct svc_req *rqstp, SVCXPRT
 	if (rqstp->rq_proc == NULLPROC) {
 		if (svc_sendreply(transp, (xdrproc_t) xdr_void, NULL) ==
 		    FALSE) {
-			warnx("svc_sendreply failed");
+			warnx("%s: svc_sendreply failed", __func__);
 		}
 		return;
 	}
@@ -307,9 +305,8 @@ universal(struct svc_req *rqstp, SVCXPRT
 				return;
 			}
 			if (!svc_sendreply(transp, pl->p_outproc, outdata)) {
-				warnx(
-			"rpc: rpc_reg trouble replying to prog %u vers %u",
-				(unsigned)prog, (unsigned)vers);
+				warnx("%s: trouble replying to prog %u vers %u",
+				    __func__, (unsigned)prog, (unsigned)vers);
 				mutex_unlock(&proglst_lock);
 				return;
 			}
@@ -320,7 +317,7 @@ universal(struct svc_req *rqstp, SVCXPRT
 		}
 	mutex_unlock(&proglst_lock);
 	/* This should never happen */
-	warnx("rpc: rpc_reg: never registered prog %u vers %u",
-		(unsigned)prog, (unsigned)vers);
+	warnx("%s: never registered prog %u vers %u", __func__,
+	    (unsigned)prog, (unsigned)vers);
 	return;
 }
Index: src/lib/libc/rpc/xdr.c
diff -u src/lib/libc/rpc/xdr.c:1.31 src/lib/libc/rpc/xdr.c:1.32
--- src/lib/libc/rpc/xdr.c:1.31	Mon Jun 25 18:32:45 2012
+++ src/lib/libc/rpc/xdr.c	Mon Mar  4 12:17:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr.c,v 1.31 2012/06/25 22:32:45 abs Exp $	*/
+/*	$NetBSD: xdr.c,v 1.32 2013/03/04 17:17:57 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)xdr.c 1.35 87/08/12";
 static char *sccsid = "@(#)xdr.c	2.1 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr.c,v 1.31 2012/06/25 22:32:45 abs Exp $");
+__RCSID("$NetBSD: xdr.c,v 1.32 2013/03/04 17:17:57 christos Exp $");
 #endif
 #endif
 
@@ -619,7 +619,7 @@ xdr_bytes(XDR *xdrs, char **cpp, u_int *
 			*cpp = sp = mem_alloc(nodesize);
 		}
 		if (sp == NULL) {
-			warnx("xdr_bytes: out of memory");
+			warn("%s: out of memory", __func__);
 			return (FALSE);
 		}
 		/* FALLTHROUGH */
@@ -768,7 +768,7 @@ xdr_string(XDR *xdrs, char **cpp, u_int 
 		if (sp == NULL)
 			*cpp = sp = mem_alloc(nodesize);
 		if (sp == NULL) {
-			warnx("xdr_string: out of memory");
+			warn("%s: out of memory", __func__);
 			return (FALSE);
 		}
 		sp[size] = 0;

Index: src/lib/libc/rpc/svc_vc.c
diff -u src/lib/libc/rpc/svc_vc.c:1.26 src/lib/libc/rpc/svc_vc.c:1.27
--- src/lib/libc/rpc/svc_vc.c:1.26	Tue Mar 20 13:14:50 2012
+++ src/lib/libc/rpc/svc_vc.c	Mon Mar  4 12:17:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc_vc.c,v 1.26 2012/03/20 17:14:50 matt Exp $	*/
+/*	$NetBSD: svc_vc.c,v 1.27 2013/03/04 17:17:56 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)svc_tcp.c	2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: svc_vc.c,v 1.26 2012/03/20 17:14:50 matt Exp $");
+__RCSID("$NetBSD: svc_vc.c,v 1.27 2013/03/04 17:17:56 christos Exp $");
 #endif
 #endif
 
@@ -145,7 +145,7 @@ svc_vc_create(int fd, u_int sendsize, u_
 
 	r = mem_alloc(sizeof(*r));
 	if (r == NULL) {
-		warnx("svc_vc_create: out of memory");
+		warn("%s: out of memory", __func__);
 		return NULL;
 	}
 	r->sendsize = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsize);
@@ -153,7 +153,7 @@ svc_vc_create(int fd, u_int sendsize, u_
 	r->maxrec = __svc_maxrec;
 	xprt = mem_alloc(sizeof(SVCXPRT));
 	if (xprt == NULL) {
-		warnx("svc_vc_create: out of memory");
+		warn("%s: out of memory", __func__);
 		goto cleanup_svc_vc_create;
 	}
 	xprt->xp_tp = NULL;
@@ -167,7 +167,7 @@ svc_vc_create(int fd, u_int sendsize, u_
 
 	slen = sizeof (struct sockaddr_storage);
 	if (getsockname(fd, (struct sockaddr *)(void *)&sslocal, &slen) < 0) {
-		warnx("svc_vc_create: could not retrieve local addr");
+		warn("%s: could not retrieve local addr", __func__);
 		goto cleanup_svc_vc_create;
 	}
 
@@ -182,7 +182,7 @@ svc_vc_create(int fd, u_int sendsize, u_
 	xprt->xp_ltaddr.maxlen = xprt->xp_ltaddr.len = sslocal.ss_len;
 	xprt->xp_ltaddr.buf = mem_alloc((size_t)sslocal.ss_len);
 	if (xprt->xp_ltaddr.buf == NULL) {
-		warnx("svc_vc_create: no mem for local addr");
+		warn("%s: out of memory", __func__);
 		goto cleanup_svc_vc_create;
 	}
 	memcpy(xprt->xp_ltaddr.buf, &sslocal, (size_t)sslocal.ss_len);
@@ -217,26 +217,26 @@ svc_fd_create(int fd, u_int sendsize, u_
 
 	slen = sizeof (struct sockaddr_storage);
 	if (getsockname(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
-		warnx("svc_fd_create: could not retrieve local addr");
+		warn("%s: could not retrieve local addr", __func__);
 		goto freedata;
 	}
 	ret->xp_ltaddr.maxlen = ret->xp_ltaddr.len = ss.ss_len;
 	ret->xp_ltaddr.buf = mem_alloc((size_t)ss.ss_len);
 	if (ret->xp_ltaddr.buf == NULL) {
-		warnx("svc_fd_create: no mem for local addr");
+		warn("%s: out of memory", __func__);
 		goto freedata;
 	}
 	memcpy(ret->xp_ltaddr.buf, &ss, (size_t)ss.ss_len);
 
 	slen = sizeof (struct sockaddr_storage);
 	if (getpeername(fd, (struct sockaddr *)(void *)&ss, &slen) < 0) {
-		warnx("svc_fd_create: could not retrieve remote addr");
+		warn("%s: could not retrieve remote addr", __func__);
 		goto freedata;
 	}
 	ret->xp_rtaddr.maxlen = ret->xp_rtaddr.len = ss.ss_len;
 	ret->xp_rtaddr.buf = mem_alloc((size_t)ss.ss_len);
 	if (ret->xp_rtaddr.buf == NULL) {
-		warnx("svc_fd_create: no mem for local addr");
+		warn("%s: out of memory", __func__);
 		goto freedata;
 	}
 	memcpy(ret->xp_rtaddr.buf, &ss, (size_t)ss.ss_len);

Index: src/lib/libc/rpc/xdr_array.c
diff -u src/lib/libc/rpc/xdr_array.c:1.17 src/lib/libc/rpc/xdr_array.c:1.18
--- src/lib/libc/rpc/xdr_array.c:1.17	Mon Jun 25 18:32:45 2012
+++ src/lib/libc/rpc/xdr_array.c	Mon Mar  4 12:17:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr_array.c,v 1.17 2012/06/25 22:32:45 abs Exp $	*/
+/*	$NetBSD: xdr_array.c,v 1.18 2013/03/04 17:17:57 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)xdr_array.c	2.1 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr_array.c,v 1.17 2012/06/25 22:32:45 abs Exp $");
+__RCSID("$NetBSD: xdr_array.c,v 1.18 2013/03/04 17:17:57 christos Exp $");
 #endif
 #endif
 
@@ -102,7 +102,7 @@ xdr_array(XDR *xdrs, caddr_t *addrp, u_i
 				return (TRUE);
 			*addrp = target = mem_alloc(nodesize);
 			if (target == NULL) {
-				warnx("xdr_array: out of memory");
+				warn("%s: out of memory", __func__);
 				return (FALSE);
 			}
 			memset(target, 0, nodesize);

Index: src/lib/libc/rpc/xdr_rec.c
diff -u src/lib/libc/rpc/xdr_rec.c:1.33 src/lib/libc/rpc/xdr_rec.c:1.34
--- src/lib/libc/rpc/xdr_rec.c:1.33	Tue Mar 20 13:14:50 2012
+++ src/lib/libc/rpc/xdr_rec.c	Mon Mar  4 12:17:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr_rec.c,v 1.33 2012/03/20 17:14:50 matt Exp $	*/
+/*	$NetBSD: xdr_rec.c,v 1.34 2013/03/04 17:17:57 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)xdr_rec.c	2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr_rec.c,v 1.33 2012/03/20 17:14:50 matt Exp $");
+__RCSID("$NetBSD: xdr_rec.c,v 1.34 2013/03/04 17:17:57 christos Exp $");
 #endif
 #endif
 
@@ -187,7 +187,7 @@ xdrrec_create(
 	RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM));
 
 	if (rstrm == NULL) {
-		warnx("xdrrec_create: out of memory");
+		warn("%s: out of memory", __func__);
 		/* 
 		 *  This is bad.  Should rework xdrrec_create to 
 		 *  return a handle, and in this case return NULL
@@ -198,7 +198,7 @@ xdrrec_create(
 	rstrm->sendsize = sendsize = fix_buf_size(sendsize);
 	rstrm->out_base = malloc(rstrm->sendsize);
 	if (rstrm->out_base == NULL) {
-		warnx("xdrrec_create: out of memory");
+		warn("%s: out of memory", __func__);
 		mem_free(rstrm, sizeof(RECSTREAM));
 		return;
 	}
@@ -206,7 +206,7 @@ xdrrec_create(
 	rstrm->recvsize = recvsize = fix_buf_size(recvsize);
 	rstrm->in_base = malloc(recvsize);
 	if (rstrm->in_base == NULL) {
-		warnx("xdrrec_create: out of memory");
+		warn("%s: out of memory", __func__);
 		mem_free(rstrm->out_base, sendsize);
 		mem_free(rstrm, sizeof(RECSTREAM));
 		return;

Index: src/lib/libc/rpc/xdr_reference.c
diff -u src/lib/libc/rpc/xdr_reference.c:1.16 src/lib/libc/rpc/xdr_reference.c:1.17
--- src/lib/libc/rpc/xdr_reference.c:1.16	Mon Jun 25 18:32:45 2012
+++ src/lib/libc/rpc/xdr_reference.c	Mon Mar  4 12:17:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: xdr_reference.c,v 1.16 2012/06/25 22:32:45 abs Exp $	*/
+/*	$NetBSD: xdr_reference.c,v 1.17 2013/03/04 17:17:57 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)xdr_reference.c 1.11 87/08/11 SMI";
 static char *sccsid = "@(#)xdr_reference.c	2.1 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: xdr_reference.c,v 1.16 2012/06/25 22:32:45 abs Exp $");
+__RCSID("$NetBSD: xdr_reference.c,v 1.17 2013/03/04 17:17:57 christos Exp $");
 #endif
 #endif
 
@@ -86,7 +86,7 @@ xdr_reference(XDR *xdrs, caddr_t *pp, u_
 		case XDR_DECODE:
 			*pp = loc = mem_alloc(size);
 			if (loc == NULL) {
-				warnx("xdr_reference: out of memory");
+				warn("%s: out of memory", __func__);
 				return (FALSE);
 			}
 			memset(loc, 0, size);

Reply via email to