about summary refs log tree commit diff
path: root/nscd/aicache.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-07-01 23:02:09 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-01 23:02:09 -0400
commit99231d9abe0fd74c7957d25b08c1d1ede4cae5a0 (patch)
tree6dc0e8933810858078f847cd60b9c592f6660e6c /nscd/aicache.c
parent445b4a53ea9d6c457c5f4ac1538102d8be0a5d89 (diff)
downloadglibc-99231d9abe0fd74c7957d25b08c1d1ede4cae5a0.tar.gz
glibc-99231d9abe0fd74c7957d25b08c1d1ede4cae5a0.tar.xz
glibc-99231d9abe0fd74c7957d25b08c1d1ede4cae5a0.zip
nscd cleanups
Cleanup and optimize last patch.  Add timeout fixes also to the
services cache.
Diffstat (limited to 'nscd/aicache.c')
-rw-r--r--nscd/aicache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nscd/aicache.c b/nscd/aicache.c
index b1369214ea..8d100f8d31 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -512,14 +512,15 @@ next_nip:
 	TEMP_FAILURE_RETRY (send (fd, &notfound, total, MSG_NOSIGNAL));
 
       /* If we cannot permanently store the result, so be it.  */
-      if (db->negtimeout == 0)
+      if (__builtin_expect (db->negtimeout == 0, 0))
 	{
 	  /* Mark the old entry as obsolete.  */
 	  if (dh != NULL)
 	    dh->usable = false;
 	  dataset = NULL;
 	}
-      else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
+      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;