Do not redeclare mutexes for darwin
authorBenjamin Kaduk <kaduk@mit.edu>
Wed, 18 Mar 2015 14:35:33 +0000 (10:35 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 22 Mar 2015 15:23:33 +0000 (11:23 -0400)
Partially revert commit e2e93aa8920c0b1bfc672a555a59eb4e15dbeaae,
which added local declarations for des_init_mutex, des_random_mutex,
and rxkad_random_mutex to a number of files in libadmin, apparently
to fix the build on macos 10.3.  That OS is long EoL-ed, and
more recent versions of OS X include toolchains that do not
need these extra declarations.  In particular, the extra declarations
can be harmful when these files start to pull in more symbols
from our libraries (e.g., libafscp), since the details of the
linking process can cause that to generate duplicate symbol errors.

There is no longer any need to have local declarations of these
symbols for OS X, so just remove them.

Change-Id: Ie152387b4bd16b470054821fc8ddf852e1a4285c
Reviewed-on: http://gerrit.openafs.org/11798
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

22 files changed:
src/libadmin/samples/cm_client_config.c
src/libadmin/samples/cm_list_cells.c
src/libadmin/samples/cm_local_cell.c
src/libadmin/samples/cm_server_prefs.c
src/libadmin/samples/rxdebug_basic_stats.c
src/libadmin/samples/rxdebug_conns.c
src/libadmin/samples/rxdebug_peers.c
src/libadmin/samples/rxdebug_rx_stats.c
src/libadmin/samples/rxdebug_supported_stats.c
src/libadmin/samples/rxdebug_version.c
src/libadmin/samples/rxstat_clear_peer.c
src/libadmin/samples/rxstat_clear_process.c
src/libadmin/samples/rxstat_disable_peer.c
src/libadmin/samples/rxstat_disable_process.c
src/libadmin/samples/rxstat_enable_peer.c
src/libadmin/samples/rxstat_enable_process.c
src/libadmin/samples/rxstat_get_peer.c
src/libadmin/samples/rxstat_get_process.c
src/libadmin/samples/rxstat_get_version.c
src/libadmin/samples/rxstat_query_peer.c
src/libadmin/samples/rxstat_query_process.c
src/libadmin/test/afscp.c

index 34dd62a..1b758f3 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index b85d58c..2034c87 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 9803a5e..ee2cfdf 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 2e2d029..d9fd784 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 2e5ca00..d4a987f 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index bd623d6..a3c1b67 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 2438a66..35ba342 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 6dbf9f7..4da2611 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 0169d2d..be5e440 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 4721f43..cf59dbb 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 6d9d47d..6d89d52 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index d9742a6..8cb9409 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index a18d8ea..71a7e6e 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index e06c1d2..7374f0e 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 8d8a1a5..a4234b6 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 4489daa..bdcd0c2 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index cc4bd7a..f5dc4ed 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 #include <afs/afsint.h>
 #define FSINT_COMMON_XG
 #include <afs/afscbint.h>
index 2e53dac..cd1a877 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 #include <afs/afsint.h>
 #define FSINT_COMMON_XG
 #include <afs/afscbint.h>
index 4d53771..42edf5b 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index d52199c..174c399 100644 (file)
 #include <afs/afs_clientAdmin.h>
 #include <afs/afs_utilAdmin.h>
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index eed2091..5dc00b8 100644 (file)
 #include <afs/afs_utilAdmin.h>
 
 
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
-
 void
 Usage(void)
 {
index 4eb0c3e..bb21a3e 100644 (file)
 void *cellHandle;
 void *tokenHandle;
 int existing_tokens = 0;
-#ifdef AFS_DARWIN_ENV
-pthread_mutex_t des_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t des_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t rxkad_random_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* AFS_DARWIN_ENV */
 
 /*
  * Before processing any command, process the common arguments and