]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nscd/initgrcache.c
nscd cleanups
[thirdparty/glibc.git] / nscd / initgrcache.c
index 7fd564d0bc97f326a94dc0fa9dc34292111206ce..4ac9942aebaaaa8e62fc107df9c5da7ff9103eaf 100644 (file)
@@ -1,5 +1,5 @@
 /* Cache handling for host lookup.
-   Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2004-2006, 2008, 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
 
@@ -203,13 +203,14 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
                                                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;
            }
-         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;