Clean the sample saving script.
1 [Taken from ../glibc-2.3.2/glibc-2.3.2-allow-gcc-3.4-sunrpc.patch,
2 rediffed, and with a fix for sunrpc/auth_none.c that was
3 inexplicably not included in the original patch.]
7 auth_none.c: In function 'authnone_create':
8 auth_none.c:83: error: invalid lvalue in assignment
9 clnt_perr.c: In function '_buf':
10 clnt_perr.c:68: error: invalid lvalue in assignment
11 clnt_raw.c: In function 'clntraw_create':
12 clnt_raw.c:103: error: invalid lvalue in assignment
13 clnt_simp.c: In function 'callrpc':
14 clnt_simp.c:78: error: invalid lvalue in assignment
17 building glibc-2.2.5 with gcc-4.0.
21 http://sources.redhat.com/ml/libc-hacker/2004-02/msg00005.html
22 [Also in CVS, but the original patch is easier to get.]
26 clnt_perr.c: In function `_buf':
27 clnt_perr.c:67: error: invalid lvalue in assignment
29 when building with gcc-3.5.
31 To: libc-hacker at sources dot redhat dot com
32 Subject: Fix cast as lvalue in sunrpc
33 From: Andreas Schwab <schwab at suse dot de>
34 X-Yow: SHHHH!! I hear SIX TATTOOED TRUCK-DRIVERS tossing ENGINE BLOCKS
35 into empty OIL DRUMS dot dot
36 Date: Sun, 08 Feb 2004 17:38:31 +0100
37 Message-ID: <je4qu1frw8.fsf@sykes.suse.de>
39 This fixes the uses of casts as lvalue in the sunrpc code.
43 2004-02-08 Andreas Schwab <schwab@suse.de>
45 * include/rpc/rpc.h: Declare thread variables with their correct
47 * sunrpc/clnt_perr.c: Don't cast thread variables.
48 * sunrpc/clnt_raw.c: Likewise.
49 * sunrpc/clnt_simp.c: Likewise.
50 * sunrpc/key_call.c: Likewise.
51 * sunrpc/svcauth_des.c: Likewise.
52 * sunrpc/svc.c: Likewise.
53 * sunrpc/svc_raw.c: Likewise.
54 * sunrpc/svc_simple.c: Likewise.
56 diff -ur glibc-2.2.5/include/rpc/rpc.h glibc-2.2.5-patched/include/rpc/rpc.h
57 --- glibc-2.2.5/include/rpc/rpc.h 2001-03-25 21:11:32.000000000 -0800
58 +++ glibc-2.2.5-patched/include/rpc/rpc.h 2005-03-11 13:18:29.810860624 -0800
61 void *authnone_private_s; /* auth_none.c */
63 - void *clnt_perr_buf_s; /* clnt_perr.c */
64 + char *clnt_perr_buf_s; /* clnt_perr.c */
66 - void *clntraw_private_s; /* clnt_raw.c */
67 + struct clntraw_private_s *clntraw_private_s; /* clnt_raw.c */
69 - void *callrpc_private_s; /* clnt_simp.c */
70 + struct callrpc_private_s *callrpc_private_s; /* clnt_simp.c */
72 - void *key_call_private_s; /* key_call.c */
73 + struct key_call_private *key_call_private_s; /* key_call.c */
75 - void *authdes_cache_s; /* svcauth_des.c */
76 - void *authdes_lru_s; /* svcauth_des.c */
77 + struct cache_entry *authdes_cache_s; /* svcauth_des.c */
78 + int *authdes_lru_s; /* svcauth_des.c */
80 - void *svc_xports_s; /* svc.c */
81 - void *svc_head_s; /* svc.c */
82 + SVCXPRT **svc_xports_s; /* svc.c */
83 + struct svc_callout *svc_head_s; /* svc.c */
85 - void *svcraw_private_s; /* svc_raw.c */
86 + struct svcraw_private_s *svcraw_private_s; /* svc_raw.c */
88 - void *svcsimple_proglst_s; /* svc_simple.c */
89 - void *svcsimple_transp_s; /* svc_simple.c */
90 + struct proglst_ *svcsimple_proglst_s; /* svc_simple.c */
91 + SVCXPRT *svcsimple_transp_s; /* svc_simple.c */
94 extern struct rpc_thread_variables *__rpc_thread_variables(void)
95 --- glibc-2.2.5/sunrpc/auth_none.c.old 2005-03-10 16:26:53.874178280 -0800
96 +++ glibc-2.2.5/sunrpc/auth_none.c 2005-03-10 16:34:24.551664888 -0800
100 #ifdef _RPC_THREAD_SAFE_
101 -#define authnone_private ((struct authnone_private_s *)RPC_THREAD_VARIABLE(authnone_private_s))
102 +#define authnone_private RPC_THREAD_VARIABLE(authnone_private_s)
104 static struct authnone_private_s *authnone_private;
106 diff -ur glibc-2.2.5/sunrpc/clnt_perr.c glibc-2.2.5-patched/sunrpc/clnt_perr.c
107 --- glibc-2.2.5/sunrpc/clnt_perr.c 2001-08-16 21:48:31.000000000 -0700
108 +++ glibc-2.2.5-patched/sunrpc/clnt_perr.c 2005-03-11 13:18:29.812860320 -0800
110 * buf variable in a few functions. Overriding a global variable
111 * with a local variable of the same name is a bad idea, anyway.
113 -#define buf ((char *)RPC_THREAD_VARIABLE(clnt_perr_buf_s))
114 +#define buf RPC_THREAD_VARIABLE(clnt_perr_buf_s)
118 diff -ur glibc-2.2.5/sunrpc/clnt_raw.c glibc-2.2.5-patched/sunrpc/clnt_raw.c
119 --- glibc-2.2.5/sunrpc/clnt_raw.c 2001-03-20 10:34:22.000000000 -0800
120 +++ glibc-2.2.5-patched/sunrpc/clnt_raw.c 2005-03-11 13:18:29.813860168 -0800
124 #ifdef _RPC_THREAD_SAFE_
125 -#define clntraw_private ((struct clntraw_private_s *)RPC_THREAD_VARIABLE(clntraw_private_s))
126 +#define clntraw_private RPC_THREAD_VARIABLE(clntraw_private_s)
128 static struct clntraw_private_s *clntraw_private;
130 diff -ur glibc-2.2.5/sunrpc/clnt_simp.c glibc-2.2.5-patched/sunrpc/clnt_simp.c
131 --- glibc-2.2.5/sunrpc/clnt_simp.c 2001-08-19 23:28:21.000000000 -0700
132 +++ glibc-2.2.5-patched/sunrpc/clnt_simp.c 2005-03-11 13:18:29.814860016 -0800
136 #ifdef _RPC_THREAD_SAFE_
137 -#define callrpc_private ((struct callrpc_private_s *)RPC_THREAD_VARIABLE(callrpc_private_s))
138 +#define callrpc_private RPC_THREAD_VARIABLE(callrpc_private_s)
140 static struct callrpc_private_s *callrpc_private;
142 diff -ur glibc-2.2.5/sunrpc/key_call.c glibc-2.2.5-patched/sunrpc/key_call.c
143 --- glibc-2.2.5/sunrpc/key_call.c 2001-03-20 10:34:22.000000000 -0800
144 +++ glibc-2.2.5-patched/sunrpc/key_call.c 2005-03-11 13:18:29.816859712 -0800
146 uid_t uid; /* user-id at last authorization */
148 #ifdef _RPC_THREAD_SAFE_
149 -#define key_call_private_main ((struct key_call_private *)RPC_THREAD_VARIABLE(key_call_private_s))
150 +#define key_call_private_main RPC_THREAD_VARIABLE(key_call_private_s)
152 static struct key_call_private *key_call_private_main;
154 diff -ur glibc-2.2.5/sunrpc/svcauth_des.c glibc-2.2.5-patched/sunrpc/svcauth_des.c
155 --- glibc-2.2.5/sunrpc/svcauth_des.c 2001-08-19 23:37:09.000000000 -0700
156 +++ glibc-2.2.5-patched/sunrpc/svcauth_des.c 2005-03-11 13:18:29.821858952 -0800
158 char *localcred; /* generic local credential */
160 #ifdef _RPC_THREAD_SAFE_
161 -#define authdes_cache ((struct cache_entry *)RPC_THREAD_VARIABLE(authdes_cache_s))
162 -#define authdes_lru ((int *)RPC_THREAD_VARIABLE(authdes_lru_s))
163 +#define authdes_cache RPC_THREAD_VARIABLE(authdes_cache_s)
164 +#define authdes_lru RPC_THREAD_VARIABLE(authdes_lru_s)
166 static struct cache_entry *authdes_cache;
167 static int *authdes_lru;
168 diff -ur glibc-2.2.5/sunrpc/svc.c glibc-2.2.5-patched/sunrpc/svc.c
169 --- glibc-2.2.5/sunrpc/svc.c 2001-03-20 10:34:22.000000000 -0800
170 +++ glibc-2.2.5-patched/sunrpc/svc.c 2005-03-11 13:18:29.817859560 -0800
172 #include <sys/poll.h>
174 #ifdef _RPC_THREAD_SAFE_
175 -#define xports ((SVCXPRT **)RPC_THREAD_VARIABLE(svc_xports_s))
176 +#define xports RPC_THREAD_VARIABLE(svc_xports_s)
178 static SVCXPRT **xports;
181 void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
183 #ifdef _RPC_THREAD_SAFE_
184 -#define svc_head ((struct svc_callout *)RPC_THREAD_VARIABLE(svc_head_s))
185 +#define svc_head RPC_THREAD_VARIABLE(svc_head_s)
187 static struct svc_callout *svc_head;
189 diff -ur glibc-2.2.5/sunrpc/svc_raw.c glibc-2.2.5-patched/sunrpc/svc_raw.c
190 --- glibc-2.2.5/sunrpc/svc_raw.c 2001-03-20 10:34:22.000000000 -0800
191 +++ glibc-2.2.5-patched/sunrpc/svc_raw.c 2005-03-11 13:18:29.818859408 -0800
193 char verf_body[MAX_AUTH_BYTES];
195 #ifdef _RPC_THREAD_SAFE_
196 -#define svcraw_private ((struct svcraw_private_s *)RPC_THREAD_VARIABLE(svcraw_private_s))
197 +#define svcraw_private RPC_THREAD_VARIABLE(svcraw_private_s)
199 static struct svcraw_private_s *svcraw_private;
201 diff -ur glibc-2.2.5/sunrpc/svc_simple.c glibc-2.2.5-patched/sunrpc/svc_simple.c
202 --- glibc-2.2.5/sunrpc/svc_simple.c 2001-08-17 00:16:04.000000000 -0700
203 +++ glibc-2.2.5-patched/sunrpc/svc_simple.c 2005-03-11 13:18:29.820859104 -0800
205 struct proglst_ *p_nxt;
207 #ifdef _RPC_THREAD_SAFE_
208 -#define proglst ((struct proglst_ *)RPC_THREAD_VARIABLE(svcsimple_proglst_s))
209 +#define proglst RPC_THREAD_VARIABLE(svcsimple_proglst_s)
211 static struct proglst_ *proglst;
215 static void universal (struct svc_req *rqstp, SVCXPRT *transp_s);
216 #ifdef _RPC_THREAD_SAFE_
217 -#define transp ((SVCXPRT *)RPC_THREAD_VARIABLE(svcsimple_transp_s))
218 +#define transp RPC_THREAD_VARIABLE(svcsimple_transp_s)
220 static SVCXPRT *transp;