mirror of
https://sourceware.org/git/glibc.git
synced 2025-05-25 17:02:34 +03:00
(cache_add): Before returning with failure and this is the first use of the record, mark it as unusable.
This commit is contained in:
parent
7396d0a980
commit
d029664038
@ -161,6 +161,11 @@ cache_add (int type, const void *key, size_t len, struct datahead *packet,
|
|||||||
{
|
{
|
||||||
++table->head->addfailed;
|
++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. */
|
/* Mark the in-flight memory as unused. */
|
||||||
for (enum in_flight idx = 0; idx < IDX_record_data; ++idx)
|
for (enum in_flight idx = 0; idx < IDX_record_data; ++idx)
|
||||||
mem_in_flight.block[idx].dbidx = -1;
|
mem_in_flight.block[idx].dbidx = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user