Adjust cache_add calls.
authordrepper <drepper>
Sun, 18 May 2008 21:54:07 +0000 (21:54 +0000)
committerdrepper <drepper>
Sun, 18 May 2008 21:54:07 +0000 (21:54 +0000)
nscd/aicache.c
nscd/grpcache.c
nscd/hstcache.c
nscd/initgrcache.c
nscd/pwdcache.c
nscd/servicescache.c

index 7ae5a16..5ffab76 100644 (file)
@@ -558,7 +558,7 @@ next_nip:
       pthread_rwlock_rdlock (&db->lock);
 
       (void) cache_add (req->type, key_copy, req->key_len, &dataset->head,
-                       true, db, uid);
+                       true, db, uid, he == NULL);
 
       pthread_rwlock_unlock (&db->lock);
 
index 9921ae3..e391dc3 100644 (file)
@@ -147,7 +147,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
              pthread_rwlock_rdlock (&db->lock);
 
              (void) cache_add (req->type, &dataset->strdata, req->key_len,
-                               &dataset->head, true, db, owner);
+                               &dataset->head, true, db, owner, he == NULL);
 
              pthread_rwlock_unlock (&db->lock);
 
@@ -353,7 +353,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
          if (req->type == GETGRBYGID)
            {
              if (cache_add (GETGRBYGID, cp, key_offset, &dataset->head, true,
-                            db, owner) < 0)
+                            db, owner, he == NULL) < 0)
                goto out;
 
              first = false;
@@ -362,7 +362,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
          else if (strcmp (key_copy, gr_name) != 0)
            {
              if (cache_add (GETGRBYNAME, key_copy, key_len + 1,
-                            &dataset->head, true, db, owner) < 0)
+                            &dataset->head, true, db, owner, he == NULL) < 0)
                goto out;
 
              first = false;
@@ -372,12 +372,13 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
          if ((req->type == GETGRBYNAME || db->propagate)
              && __builtin_expect (cache_add (GETGRBYNAME, gr_name,
                                              gr_name_len,
-                                             &dataset->head, first, db, owner)
+                                             &dataset->head, first, db, owner,
+                                             he == NULL)
                                   == 0, 1))
            {
              if (req->type == GETGRBYNAME && db->propagate)
                (void) cache_add (GETGRBYGID, cp, key_offset, &dataset->head,
-                                 false, db, owner);
+                                 false, db, owner, false);
            }
 
        out:
index 3ceb671..d4dd51f 100644 (file)
@@ -156,7 +156,7 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
              pthread_rwlock_rdlock (&db->lock);
 
              (void) cache_add (req->type, &dataset->strdata, req->key_len,
-                               &dataset->head, true, db, owner);
+                               &dataset->head, true, db, owner, he == NULL);
 
              pthread_rwlock_unlock (&db->lock);
 
@@ -408,7 +408,7 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
                  || req->type == GETHOSTBYADDRv6);
 
          (void) cache_add (req->type, key_copy, req->key_len,
-                           &dataset->head, true, db, owner);
+                           &dataset->head, true, db, owner, he == NULL);
 
          pthread_rwlock_unlock (&db->lock);
        }
index 94e909d..3355df5 100644 (file)
@@ -231,7 +231,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
              pthread_rwlock_rdlock (&db->lock);
 
              (void) cache_add (req->type, key_copy, req->key_len,
-                               &dataset->head, true, db, uid);
+                               &dataset->head, true, db, uid, he == NULL);
 
              pthread_rwlock_unlock (&db->lock);
 
@@ -398,7 +398,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
          pthread_rwlock_rdlock (&db->lock);
 
          (void) cache_add (INITGROUPS, cp, req->key_len, &dataset->head, true,
-                           db, uid);
+                           db, uid, he == NULL);
 
          pthread_rwlock_unlock (&db->lock);
        }
index 2d0a265..4a0cabd 100644 (file)
@@ -154,7 +154,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
              pthread_rwlock_rdlock (&db->lock);
 
              (void) cache_add (req->type, key_copy, req->key_len,
-                               &dataset->head, true, db, owner);
+                               &dataset->head, true, db, owner, he == NULL);
 
              pthread_rwlock_unlock (&db->lock);
 
@@ -348,7 +348,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
          if (req->type == GETPWBYUID)
            {
              if (cache_add (GETPWBYUID, cp, key_offset, &dataset->head, true,
-                            db, owner) < 0)
+                            db, owner, he == NULL) < 0)
                goto out;
 
              first = false;
@@ -357,7 +357,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
          else if (strcmp (key_copy, dataset->strdata) != 0)
            {
              if (cache_add (GETPWBYNAME, key_copy, key_len + 1,
-                            &dataset->head, true, db, owner) < 0)
+                            &dataset->head, true, db, owner, he == NULL) < 0)
                goto out;
 
              first = false;
@@ -367,11 +367,12 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
          if ((req->type == GETPWBYNAME || db->propagate)
              && __builtin_expect (cache_add (GETPWBYNAME, dataset->strdata,
                                              pw_name_len, &dataset->head,
-                                             first, db, owner) == 0, 1))
+                                             first, db, owner, he == NULL)
+                                  == 0, 1))
            {
              if (req->type == GETPWBYNAME && db->propagate)
                (void) cache_add (GETPWBYUID, cp, key_offset, &dataset->head,
-                                 false, db, owner);
+                                 false, db, owner, false);
            }
 
        out:
index c6f0b47..c952fa1 100644 (file)
@@ -137,7 +137,7 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
              pthread_rwlock_rdlock (&db->lock);
 
              (void) cache_add (req->type, &dataset->strdata, req->key_len,
-                               &dataset->head, true, db, owner);
+                               &dataset->head, true, db, owner, he == NULL);
 
              pthread_rwlock_unlock (&db->lock);
 
@@ -331,7 +331,7 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
          pthread_rwlock_rdlock (&db->lock);
 
          (void) cache_add (req->type, key_copy, req->key_len,
-                           &dataset->head, true, db, owner);
+                           &dataset->head, true, db, owner, he == NULL);
 
          pthread_rwlock_unlock (&db->lock);
        }