about summary refs log tree commit diff
path: root/nscd/grpcache.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@suse.de>2011-07-01 22:53:01 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-01 22:53:01 -0400
commit445b4a53ea9d6c457c5f4ac1538102d8be0a5d89 (patch)
tree3058c0d00c391e0a093eca4825128db7251a8859 /nscd/grpcache.c
parent6d4d8e8eef734412bedfd3a0bcece15109155913 (diff)
downloadglibc-445b4a53ea9d6c457c5f4ac1538102d8be0a5d89.tar.gz
glibc-445b4a53ea9d6c457c5f4ac1538102d8be0a5d89.tar.xz
glibc-445b4a53ea9d6c457c5f4ac1538102d8be0a5d89.zip
Handle nscd negtimeout==0
Diffstat (limited to 'nscd/grpcache.c')
-rw-r--r--nscd/grpcache.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index 0e7f81f535..8a2f80ccdb 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -118,10 +118,14 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
 	    written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
 						MSG_NOSIGNAL));
 
-	  dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
-				   1);
 	  /* If we cannot permanently store the result, so be it.  */
-	  if (dataset != NULL)
+	  if (db->negtimeout == 0)
+	    {
+	      /* Mark the old entry as obsolete.  */
+	      if (dh != NULL)
+		dh->usable = false;
+	    }
+	  else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
 	    {
 	      dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
 	      dataset->head.recsize = total;