mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 12:30:06 +00:00
nscd: Use errval, not errno to guide cache update (bug 30662)
The errno variable is potentially clobbered by the preceding send call. It is not related to the to-be-cached information. The parallel code in hstcache.c and servicescache.c already uses errval. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
parent
c437631485
commit
2d472b4861
@ -116,7 +116,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
|
||||
|
||||
/* If we have a transient error or cannot permanently store
|
||||
the result, so be it. */
|
||||
if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
|
||||
if (errval == EAGAIN || __glibc_unlikely (db->negtimeout == 0))
|
||||
{
|
||||
/* Mark the old entry as obsolete. */
|
||||
if (dh != NULL)
|
||||
|
@ -122,7 +122,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
|
||||
|
||||
/* If we have a transient error or cannot permanently store
|
||||
the result, so be it. */
|
||||
if (errno == EAGAIN || __builtin_expect (db->negtimeout == 0, 0))
|
||||
if (errval == EAGAIN || __glibc_unlikely (db->negtimeout == 0))
|
||||
{
|
||||
/* Mark the old entry as obsolete. */
|
||||
if (dh != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user