nscd: don't unconditionally use PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP is Linux-only. * nscd/connections.c (RWLOCK_INITIALIZER): Define to PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP or PTHREAD_RWLOCK_INITIALIZER if that is not available. (dbs): Use RWLOCK_INITIALIZER instead of PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP.
This commit is contained in:
parent
2fd4bbaa14
commit
7bb087bd7b
@ -1,3 +1,8 @@
|
|||||||
|
2018-02-11 Samuel Thibault <samuel.thibault@ens-lyon.org>
|
||||||
|
|
||||||
|
* nscd/connections.c (RWLOCK_INITIALIZER): Define to
|
||||||
|
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP or
|
||||||
|
|
||||||
2018-02-10 Dmitry V. Levin <ldv@altlinux.org>
|
2018-02-10 Dmitry V. Levin <ldv@altlinux.org>
|
||||||
|
|
||||||
[BZ #22433]
|
[BZ #22433]
|
||||||
|
@ -106,11 +106,17 @@ const char *const serv2str[LASTREQ] =
|
|||||||
[GETFDNETGR] = "GETFDNETGR"
|
[GETFDNETGR] = "GETFDNETGR"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
|
||||||
|
# define RWLOCK_INITIALIZER PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
|
||||||
|
#else
|
||||||
|
# define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The control data structures for the services. */
|
/* The control data structures for the services. */
|
||||||
struct database_dyn dbs[lastdb] =
|
struct database_dyn dbs[lastdb] =
|
||||||
{
|
{
|
||||||
[pwddb] = {
|
[pwddb] = {
|
||||||
.lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
|
.lock = RWLOCK_INITIALIZER,
|
||||||
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.enabled = 0,
|
.enabled = 0,
|
||||||
@ -129,7 +135,7 @@ struct database_dyn dbs[lastdb] =
|
|||||||
.mmap_used = false
|
.mmap_used = false
|
||||||
},
|
},
|
||||||
[grpdb] = {
|
[grpdb] = {
|
||||||
.lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
|
.lock = RWLOCK_INITIALIZER,
|
||||||
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.enabled = 0,
|
.enabled = 0,
|
||||||
@ -148,7 +154,7 @@ struct database_dyn dbs[lastdb] =
|
|||||||
.mmap_used = false
|
.mmap_used = false
|
||||||
},
|
},
|
||||||
[hstdb] = {
|
[hstdb] = {
|
||||||
.lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
|
.lock = RWLOCK_INITIALIZER,
|
||||||
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.enabled = 0,
|
.enabled = 0,
|
||||||
@ -167,7 +173,7 @@ struct database_dyn dbs[lastdb] =
|
|||||||
.mmap_used = false
|
.mmap_used = false
|
||||||
},
|
},
|
||||||
[servdb] = {
|
[servdb] = {
|
||||||
.lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
|
.lock = RWLOCK_INITIALIZER,
|
||||||
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.enabled = 0,
|
.enabled = 0,
|
||||||
@ -186,7 +192,7 @@ struct database_dyn dbs[lastdb] =
|
|||||||
.mmap_used = false
|
.mmap_used = false
|
||||||
},
|
},
|
||||||
[netgrdb] = {
|
[netgrdb] = {
|
||||||
.lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
|
.lock = RWLOCK_INITIALIZER,
|
||||||
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
.prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
|
||||||
.enabled = 0,
|
.enabled = 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user