PATCH: Fix RPC/raw
H . J . Lu
hjl@lucon.org
Sun Apr 14 00:24:00 GMT 2002
On Fri, Apr 12, 2002 at 01:06:59PM -0700, Zack Weinberg wrote:
> > > I would not be surprised if there were more threading bugs in the
> > > sunrpc directory -- for instance, while developing that test program I
> > > discovered that (clnt|svc)raw_create were completely broken by the
> > > thread changes. As in "this code cannot possibly work anymore, even
> > > single-threaded."
> >
> > A testcase?
>
> Appended. It's just the same program using raw transport instead of
> udp, but it crashes in svcraw_create(). I was going to send a patch
> for that one as soon as the first patch got applied.
>
How about this patch?
H.J.
----
2002-04-12 H.J. Lu <hjl@gnu.org>
* sunrpc/clnt_raw.c (clntraw_create): Properly set xdrs and
client.
--- sunrpc/clnt_raw.c.raw Tue Feb 26 10:32:57 2002
+++ sunrpc/clnt_raw.c Fri Apr 12 17:00:33 2002
@@ -92,8 +92,8 @@ clntraw_create (u_long prog, u_long vers
{
struct clntraw_private_s *clp = clntraw_private;
struct rpc_msg call_msg;
- XDR *xdrs = &clp->xdr_stream;
- CLIENT *client = &clp->client_object;
+ XDR *xdrs;
+ CLIENT *client;
if (clp == 0)
{
@@ -102,6 +102,8 @@ clntraw_create (u_long prog, u_long vers
return (0);
clntraw_private = clp;
}
+ xdrs = &clp->xdr_stream;
+ client = &clp->client_object;
/*
* pre-serialize the static part of the call msg and stash it away
*/
More information about the Libc-alpha
mailing list