summaryrefslogtreecommitdiffstats
path: root/nscd/nscd_netgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_netgroup.c')
-rw-r--r--nscd/nscd_netgroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/nscd/nscd_netgroup.c b/nscd/nscd_netgroup.c
index 7e51dd3d94..11b7f3214c 100644
--- a/nscd/nscd_netgroup.c
+++ b/nscd/nscd_netgroup.c
@@ -148,7 +148,7 @@ __nscd_setnetgrent (const char *group, struct __netgrent *datap)
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;
}
@@ -272,7 +272,7 @@ __nscd_innetgr (const char *netgroup, const char *host, const char *user,
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;
}