Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/rpc - Use -1 for the fake raw fd since we will be a...
details: https://anonhg.NetBSD.org/src/rev/921987036c2f
branches: trunk
changeset: 341447:921987036c2f
user: christos <christos%NetBSD.org@localhost>
date: Fri Nov 06 19:32:08 2015 +0000
description:
- Use -1 for the fake raw fd since we will be able to go beyond FD_SETSIZE.
- Poster boy for why it is bad to initialize in declarations :-)
diffstat:
lib/libc/rpc/clnt_raw.c | 18 +++++++++++-------
lib/libc/rpc/svc_raw.c | 6 +++---
2 files changed, 14 insertions(+), 10 deletions(-)
diffs (83 lines):
diff -r 2aa0a335f251 -r 921987036c2f lib/libc/rpc/clnt_raw.c
--- a/lib/libc/rpc/clnt_raw.c Fri Nov 06 15:41:25 2015 +0000
+++ b/lib/libc/rpc/clnt_raw.c Fri Nov 06 19:32:08 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clnt_raw.c,v 1.32 2013/03/11 20:19:29 tron Exp $ */
+/* $NetBSD: clnt_raw.c,v 1.33 2015/11/06 19:32:08 christos Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -37,7 +37,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.32 2013/03/11 20:19:29 tron Exp $");
+__RCSID("$NetBSD: clnt_raw.c,v 1.33 2015/11/06 19:32:08 christos Exp $");
#endif
#endif
@@ -102,13 +102,13 @@
CLIENT *
clnt_raw_create(rpcprog_t prog, rpcvers_t vers)
{
- struct clntraw_private *clp = clntraw_private;
+ struct clntraw_private *clp;
struct rpc_msg call_msg;
- XDR *xdrs = &clp->xdr_stream;
- CLIENT *client = &clp->client_object;
+ XDR *xdrs;
+ CLIENT *client;
mutex_lock(&clntraw_lock);
- if (clp == NULL) {
+ if ((clp = clntraw_private) == NULL) {
clp = calloc((size_t)1, sizeof (*clp));
if (clp == NULL)
goto out;
@@ -120,6 +120,10 @@
clp->_raw_buf = __rpc_rawcombuf;
clntraw_private = clp;
}
+
+ xdrs = &clp->xdr_stream;
+ client = &clp->client_object;
+
/*
* pre-serialize the static part of the call msg and stash it away
*/
@@ -193,7 +197,7 @@
* We have to call server input routine here because this is
* all going on in one process. Yuk.
*/
- svc_getreq_common(FD_SETSIZE);
+ svc_getreq_common(-1);
/*
* get results
diff -r 2aa0a335f251 -r 921987036c2f lib/libc/rpc/svc_raw.c
--- a/lib/libc/rpc/svc_raw.c Fri Nov 06 15:41:25 2015 +0000
+++ b/lib/libc/rpc/svc_raw.c Fri Nov 06 19:32:08 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: svc_raw.c,v 1.24 2013/03/11 20:19:29 tron Exp $ */
+/* $NetBSD: svc_raw.c,v 1.25 2015/11/06 19:32:08 christos Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)svc_raw.c 1.25 89/01/31 Copyr 1984 Sun Micro";
#else
-__RCSID("$NetBSD: svc_raw.c,v 1.24 2013/03/11 20:19:29 tron Exp $");
+__RCSID("$NetBSD: svc_raw.c,v 1.25 2015/11/06 19:32:08 christos Exp $");
#endif
#endif
@@ -113,7 +113,7 @@
srp->raw_buf = __rpc_rawcombuf; /* Share it with the client */
svc_raw_private = srp;
}
- srp->server.xp_fd = FD_SETSIZE;
+ srp->server.xp_fd = -1;
srp->server.xp_port = 0;
srp->server.xp_p3 = NULL;
svc_raw_ops(&srp->server);
Home |
Main Index |
Thread Index |
Old Index