diff options
author | Ulrich Drepper <drepper@redhat.com> | 2008-05-11 03:02:25 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2008-05-11 03:02:25 +0000 |
commit | d029664038effc7a3862768c4b615e80e1009ffb (patch) | |
tree | 9a8411696ae74fe47e9641ca9a6c6edf9dd0e9b6 /nscd | |
parent | 7396d0a980f9b7aed43a15dee83dfd411c508766 (diff) | |
download | glibc-d029664038effc7a3862768c4b615e80e1009ffb.tar.gz glibc-d029664038effc7a3862768c4b615e80e1009ffb.tar.xz glibc-d029664038effc7a3862768c4b615e80e1009ffb.zip |
(cache_add): Before returning with failure and this is the first use of the record, mark it as unusable.
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/cache.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nscd/cache.c b/nscd/cache.c index b1dc2c5052..f4a9de530a 100644 --- a/nscd/cache.c +++ b/nscd/cache.c @@ -161,6 +161,11 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet, { ++table->head->addfailed; + /* If necessary mark the entry as unusable so that lookups will + not use it. */ + if (first) + packet->usable = false; + /* Mark the in-flight memory as unused. */ for (enum in_flight idx = 0; idx < IDX_record_data; ++idx) mem_in_flight.block[idx].dbidx = -1; |