summaryrefslogtreecommitdiffstats
path: root/nscd/nscd_initgroups.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_initgroups.c')
-rw-r--r--nscd/nscd_initgroups.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nscd/nscd_initgroups.c b/nscd/nscd_initgroups.c
index dfce76a060..47b6deb069 100644
--- a/nscd/nscd_initgroups.c
+++ b/nscd/nscd_initgroups.c
@@ -166,7 +166,7 @@ __nscd_getgrouplist (const char *user, gid_t group, long int *size,
if ((gc_cycle & 1) != 0 || ++nretries == 5 || retval == -1)
{
/* nscd is just running gc now. Disable using the mapping. */
- if (atomic_decrement_val (&mapped->counter) == 0)
+ if (atomic_fetch_add_relaxed (&mapped->counter, -1) == 1)
__nscd_unmap (mapped);
mapped = NO_MAPPING;
}