]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
sunrpc: Remove always-defined _RPC_THREAD_SAFE_ macro
authorFlorian Weimer <fweimer@redhat.com>
Tue, 26 Jun 2018 13:27:03 +0000 (15:27 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 26 Jun 2018 13:27:03 +0000 (15:27 +0200)
Header and C source file changes were generated using:

unifdef -m -D_RPC_THREAD_SAFE_ include/rpc/rpc.h sunrpc/*.c

14 files changed:
ChangeLog
include/rpc/rpc.h
sunrpc/Makefile
sunrpc/clnt_perr.c
sunrpc/clnt_raw.c
sunrpc/clnt_simp.c
sunrpc/key_call.c
sunrpc/rpc_common.c
sunrpc/rpc_main.c
sunrpc/rpc_thread.c
sunrpc/svc.c
sunrpc/svc_raw.c
sunrpc/svc_simple.c
sunrpc/svcauth_des.c

index 511128c6dddcb2acf0695cc93f7eaf109d6d8eef..5cd85668d5ec57762d0cae2afac6de232f5de6eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2018-06-26  Florian Weimer  <fweimer@redhat.com>
+
+       Remove always-defined _RPC_THREAD_SAFE_ macro.
+       * sunrpc/Makefile (sunrpc-CPPFLAGS, CPPFLAGS, BUILD_CPPFLAGS):
+       Do not define _RPC_THREAD_SAFE_.
+       * include/rpc/rpc.h: Remove _RPC_THREAD_SAFE_ preprocessor
+       conditional.
+       * sunrpc/clnt_perr.c: Likewise.
+       * sunrpc/clnt_raw.c: Likewise.
+       * sunrpc/clnt_simp.c: Likewise.
+       * sunrpc/key_call.c: Likewise.
+       * sunrpc/rpc_common.c: Likewise.
+       * sunrpc/rpc_main.c: Likewise.
+       * sunrpc/rpc_thread.c: Likewise.
+       * sunrpc/svc.c: Likewise.
+       * sunrpc/svc_raw.c: Likewise.
+       * sunrpc/svc_simple.c: Likewise.
+       * sumrpc/svcauth_des.c: Likewise.
+
 2018-06-26  Florian Weimer  <fweimer@redhat.com>
 
        * libio/Makefile (tests-internal): Add tst-vtables,
index 1fb925e85ca914a345172883022730f4b7ffcc45..327d84319e8b3278bf1e2eaa0afedaf088eb12ae 100644 (file)
@@ -13,7 +13,6 @@ extern unsigned long _create_xid (void);
  * Group all global and static variables into a single spot.
  * This area is allocated on a per-thread basis
  */
-#ifdef _RPC_THREAD_SAFE_
 struct rpc_thread_variables {
        fd_set          svc_fdset_s;            /* Global, rpc_common.c */
        struct rpc_createerr rpc_createerr_s;   /* Global, rpc_common.c */
@@ -63,7 +62,5 @@ libc_hidden_proto (__rpc_thread_createerr)
 int __libc_rpc_gethostbyname (const char *host, struct sockaddr_in *addr)
   attribute_hidden;
 
-#endif /* _RPC_THREAD_SAFE_ */
-
 # endif /* !_ISOMAC */
 #endif
index 8f2a3c8213e3564ebb5353bdb8fecc8e124bc33b..0e2f8d7c9e5fcefbad96ea688a6df05197d39fae 100644 (file)
@@ -156,10 +156,6 @@ CFLAGS-pmap_rmt.c += -fexceptions
 CFLAGS-clnt_perr.c += -fexceptions
 CFLAGS-openchild.c += -fexceptions
 
-sunrpc-CPPFLAGS = -D_RPC_THREAD_SAFE_
-CPPFLAGS += $(sunrpc-CPPFLAGS)
-BUILD_CPPFLAGS += $(sunrpc-CPPFLAGS)
-
 $(objpfx)tst-getmyaddr: $(common-objpfx)linkobj/libc.so
 $(objpfx)tst-xdrmem: $(common-objpfx)linkobj/libc.so
 $(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
index cac1dd9913d8ab3bdd77a6ca1485efaaf11c5133..dd5b10688ea4d2e862c7be6a4358c50e17685e39 100644 (file)
 
 static char *auth_errmsg (enum auth_stat stat);
 
-#ifdef _RPC_THREAD_SAFE_
 /*
  * Making buf a preprocessor macro requires renaming the local
  * buf variable in a few functions.  Overriding a global variable
  * with a local variable of the same name is a bad idea, anyway.
  */
 #define buf RPC_THREAD_VARIABLE(clnt_perr_buf_s)
-#else
-static char *buf;
-#endif
 
 /*
  * Print reply error info
index d62a11a2cadf3fab4e52dc26906b34a6d97d5801..5b9bd482478760eee106566f7c413ad32fe84203 100644 (file)
@@ -59,11 +59,7 @@ struct clntraw_private_s
     } mashl_callmsg;
     u_int mcnt;
   };
-#ifdef _RPC_THREAD_SAFE_
 #define clntraw_private RPC_THREAD_VARIABLE(clntraw_private_s)
-#else
-static struct clntraw_private_s *clntraw_private;
-#endif
 
 static enum clnt_stat clntraw_call (CLIENT *, u_long, xdrproc_t, caddr_t,
                                    xdrproc_t, caddr_t, struct timeval);
index bdf6322fc410ea0c3e8deab66e4081085f604f48..fab61d217003e959e9d5051866823c2c8d93778f 100644 (file)
@@ -49,11 +49,7 @@ struct callrpc_private_s
     u_long oldprognum, oldversnum, valid;
     char *oldhost;
   };
-#ifdef _RPC_THREAD_SAFE_
 #define callrpc_private RPC_THREAD_VARIABLE(callrpc_private_s)
-#else
-static struct callrpc_private_s *callrpc_private;
-#endif
 
 int
 callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
@@ -123,7 +119,6 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum,
 }
 libc_hidden_nolink_sunrpc (callrpc, GLIBC_2_0)
 
-#ifdef _RPC_THREAD_SAFE_
 void
 __rpc_thread_clnt_cleanup (void)
 {
@@ -135,4 +130,3 @@ __rpc_thread_clnt_cleanup (void)
                free (rcp);
        }
 }
-#endif /* _RPC_THREAD_SAFE_ */
index a599fd9a6bda78288d2fe9625fbdd1f2d3c46ce9..9b8f9819c95797b945e3ea4f8c32a5fa22b91e34 100644 (file)
@@ -378,11 +378,7 @@ struct  key_call_private {
   pid_t   pid;            /* process-id at moment of creation */
   uid_t   uid;            /* user-id at last authorization */
 };
-#ifdef _RPC_THREAD_SAFE_
 #define key_call_private_main RPC_THREAD_VARIABLE(key_call_private_s)
-#else
-static struct key_call_private *key_call_private_main;
-#endif
 __libc_lock_define_initialized (static, keycall_lock)
 
 /*
@@ -555,7 +551,6 @@ key_call (u_long proc, xdrproc_t xdr_arg, char *arg,
 #endif
 }
 
-#ifdef _RPC_THREAD_SAFE_
 void
 __rpc_thread_key_cleanup (void)
 {
@@ -570,4 +565,3 @@ __rpc_thread_key_cleanup (void)
                free (kcp);
        }
 }
-#endif /* _RPC_THREAD_SAFE_ */
index 2d42827a872cbebb839c4bb2d8217ea456cec162..2a5d0dc1c78d432ea13810a2f446eb0f79195311 100644 (file)
 #include <rpc/rpc.h>
 #include <shlib-compat.h>
 
-#ifdef _RPC_THREAD_SAFE_
 #undef svc_fdset
 #undef rpc_createerr
 #undef svc_pollfd
 #undef svc_max_pollfd
-#endif /* _RPC_THREAD_SAFE_ */
 
 /*
  * This file should only contain common data (global data) that is exported
index f94bc91546ffe58881374ab9363d73bf4e8a11d2..c6607848cc29fe10b16f75f8f1aa065224ffee8f 100644 (file)
@@ -1341,15 +1341,6 @@ parseargs (int argc, const char *argv[], struct commandline *cmd)
   cmd->Scflag = flag['C'];
   cmd->makefileflag = flag['M'];
 
-#ifndef _RPC_THREAD_SAFE_
-  if (mtflag || newstyle)
-    {
-      /* glibc doesn't support these flags.  */
-      f_print (stderr,
-              _("This implementation doesn't support newstyle or MT-safe code!\n"));
-      return (0);
-    }
-#endif
   if (tirpcflag)
     {
       pmflag = inetdflag ? 0 : 1;    /* pmflag or inetdflag is always TRUE */
index ccbf9bb69b6f833836bbb32e8f1cd8e8cac74501..068a49f92b2ff79ab172600e826ab4f2802d130d 100644 (file)
@@ -6,7 +6,6 @@
 #include <libc-tsd.h>
 #include <shlib-compat.h>
 
-#ifdef _RPC_THREAD_SAFE_
 
 /* Variable used in non-threaded applications or for the first thread.  */
 static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem;
@@ -136,5 +135,3 @@ libc_hidden_def (__rpc_thread_svc_max_pollfd)
 #else
 libc_hidden_nolink_sunrpc (__rpc_thread_svc_max_pollfd, GLIBC_2_2_3)
 #endif
-
-#endif /* _RPC_THREAD_SAFE_ */
index 87baf6ac68b20fe1a53606451bafae83efe2bf69..90e84e2cd2824f685328026ecdc82f04da9cd51b 100644 (file)
 #include <time.h>
 #include <shlib-compat.h>
 
-#ifdef _RPC_THREAD_SAFE_
 #define xports RPC_THREAD_VARIABLE(svc_xports_s)
-#else
-static SVCXPRT **xports;
-#endif
 
 #define NULL_SVC ((struct svc_callout *)0)
 #define        RQCRED_SIZE     400     /* this size is excessive */
@@ -81,11 +77,7 @@ struct svc_callout {
   void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
   bool_t sc_mapped;
 };
-#ifdef _RPC_THREAD_SAFE_
 #define svc_head RPC_THREAD_VARIABLE(svc_head_s)
-#else
-static struct svc_callout *svc_head;
-#endif
 
 /* ***************  SVCXPRT related stuff **************** */
 
@@ -568,7 +560,6 @@ __svc_accept_failed (void)
     }
 }
 
-#ifdef _RPC_THREAD_SAFE_
 
 void
 __rpc_thread_svc_cleanup (void)
@@ -578,5 +569,3 @@ __rpc_thread_svc_cleanup (void)
   while ((svcp = svc_head) != NULL)
     svc_unregister (svcp->sc_prog, svcp->sc_vers);
 }
-
-#endif /* _RPC_THREAD_SAFE_ */
index 4787203613d241a751dabc83c8986df97d1ffeca..f0176311d5cbd9f55d234151882505915e02d75a 100644 (file)
@@ -48,11 +48,7 @@ struct svcraw_private_s
     XDR xdr_stream;
     char verf_body[MAX_AUTH_BYTES];
   };
-#ifdef _RPC_THREAD_SAFE_
 #define svcraw_private RPC_THREAD_VARIABLE(svcraw_private_s)
-#else
-static struct svcraw_private_s *svcraw_private;
-#endif
 
 static bool_t svcraw_recv (SVCXPRT *, struct rpc_msg *);
 static enum xprt_stat svcraw_stat (SVCXPRT *);
index f12ed31441f8ca094ffebff3af973dea4a2413d7..2f2595c0ffe14ded98656eaa731c6d71ccbb6f61 100644 (file)
@@ -53,19 +53,11 @@ struct proglst_
     xdrproc_t p_inproc, p_outproc;
     struct proglst_ *p_nxt;
   };
-#ifdef _RPC_THREAD_SAFE_
 #define proglst RPC_THREAD_VARIABLE(svcsimple_proglst_s)
-#else
-static struct proglst_ *proglst;
-#endif
 
 
 static void universal (struct svc_req *rqstp, SVCXPRT *transp_s);
-#ifdef _RPC_THREAD_SAFE_
 #define transp RPC_THREAD_VARIABLE(svcsimple_transp_s)
-#else
-static SVCXPRT *transp;
-#endif
 
 int
 __registerrpc (u_long prognum, u_long versnum, u_long procnum,
index 9ce4804239f8fdf17d4128952ac4149caf678587..c5a512d6f80ff3908375d6fd7fa92d9184395dff 100644 (file)
@@ -72,13 +72,8 @@ struct cache_entry
     struct rpc_timeval laststamp;      /* detect replays of creds */
     char *localcred;           /* generic local credential */
   };
-#ifdef _RPC_THREAD_SAFE_
 #define authdes_cache RPC_THREAD_VARIABLE(authdes_cache_s)
 #define authdes_lru RPC_THREAD_VARIABLE(authdes_lru_s)
-#else
-static struct cache_entry *authdes_cache;
-static int *authdes_lru;
-#endif
 
 static void cache_init (void); /* initialize the cache */
 static short cache_spot (des_block *, char *, struct rpc_timeval *);