about summary refs log tree commit diff
path: root/nscd/nscd_getai.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/nscd_getai.c')
-rw-r--r--nscd/nscd_getai.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nscd/nscd_getai.c b/nscd/nscd_getai.c
index a99a4d8142..8e4650ebae 100644
--- a/nscd/nscd_getai.c
+++ b/nscd/nscd_getai.c
@@ -198,7 +198,7 @@ __nscd_getai (const char *key, struct nscd_ai_result **result, int *h_errnop)
       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;
 	}