From: Ulrich Drepper Date: Sun, 11 May 2008 03:02:25 +0000 (+0000) Subject: (cache_add): Before returning with failure and this is the first use of the record... X-Git-Tag: upstream/2.30~14234 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d029664038effc7a3862768c4b615e80e1009ffb;p=external%2Fglibc.git (cache_add): Before returning with failure and this is the first use of the record, mark it as unusable. --- diff --git a/nscd/cache.c b/nscd/cache.c index b1dc2c5..f4a9de5 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;