(cache_add): Record the failure to add to the cache.
authorUlrich Drepper <drepper@redhat.com>
Tue, 16 Jan 2007 00:23:46 +0000 (00:23 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 16 Jan 2007 00:23:46 +0000 (00:23 +0000)
nscd/cache.c

index e63a4f8..73e7902 100644 (file)
@@ -153,7 +153,10 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet,
   newp = mempool_alloc (table, sizeof (struct hashentry));
   /* If we cannot allocate memory, just do not do anything.  */
   if (newp == NULL)
-    return -1;
+    {
+      ++table->head->addfailed;
+      return -1;
+    }
 
   newp->type = type;
   newp->first = first;