about summary refs log tree commit diff
path: root/nscd/aicache.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-11 03:03:14 +0000
committerUlrich Drepper <drepper@redhat.com>2008-05-11 03:03:14 +0000
commit7e71e55f16e037042671cf70f8f130f26e494b74 (patch)
tree866217241a4e3f1c063bfb345ef5ca7663c7059b /nscd/aicache.c
parentd029664038effc7a3862768c4b615e80e1009ffb (diff)
downloadglibc-7e71e55f16e037042671cf70f8f130f26e494b74.tar.gz
glibc-7e71e55f16e037042671cf70f8f130f26e494b74.tar.xz
glibc-7e71e55f16e037042671cf70f8f130f26e494b74.zip
* nscd/cache.c (cache_add): Before returning with failure and this
	is the first use of the record, mark it as unusable.
	* nscd/aicache.c: Don't touch the dataset after cache_add returns
	reporting a failure.
	* nscd/grpcache.c: Likewise
	* nscd/hstcache.c: Likewise.
	* nscd/initgrcache.c: Likewise.
	* nscd/pwdcache.c: Likewise.
	* nscd/servicecache.c: Likewise.
Diffstat (limited to 'nscd/aicache.c')
-rw-r--r--nscd/aicache.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/nscd/aicache.c b/nscd/aicache.c
index 4db3e65bd1..918efc9f39 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -556,10 +556,8 @@ next_nip:
       /* Now get the lock to safely insert the records.  */
       pthread_rwlock_rdlock (&db->lock);
 
-      if (cache_add (req->type, key_copy, req->key_len, &dataset->head, true,
-		     db, uid) < 0)
-	/* Ensure the data can be recovered.  */
-	dataset->head.usable = false;
+      (void) cache_add (req->type, key_copy, req->key_len, &dataset->head,
+			true, db, uid);
 
       pthread_rwlock_unlock (&db->lock);