diff options
author | Ulrich Drepper <drepper@gmail.com> | 2012-01-20 22:39:54 -0500 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2012-01-20 22:39:54 -0500 |
commit | 3e1aa84e7f9f38815f5db9cd7654b1a9497cf6e4 (patch) | |
tree | 3cf76f1f45fae89588ea78e62a41ea6f71895ca0 /nscd/hstcache.c | |
parent | 6e4b210745556ea4d74d4dc6637994756bf2d6b5 (diff) | |
download | glibc-3e1aa84e7f9f38815f5db9cd7654b1a9497cf6e4.tar.gz glibc-3e1aa84e7f9f38815f5db9cd7654b1a9497cf6e4.tar.xz glibc-3e1aa84e7f9f38815f5db9cd7654b1a9497cf6e4.zip |
Do not cache negative results in nscd if these are transient
Diffstat (limited to 'nscd/hstcache.c')
-rw-r--r-- | nscd/hstcache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nscd/hstcache.c b/nscd/hstcache.c index 4d68ade98c..c72feaa02e 100644 --- a/nscd/hstcache.c +++ b/nscd/hstcache.c @@ -1,5 +1,5 @@ /* Cache handling for host lookup. - Copyright (C) 1998-2008, 2009, 2011 Free Software Foundation, Inc. + Copyright (C) 1998-2008, 2009, 2011, 2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -141,8 +141,9 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, MSG_NOSIGNAL)) != total) all_written = false; - /* If we cannot permanently store the result, so be it. */ - if (__builtin_expect (db->negtimeout == 0, 0)) + /* If we have a transient error or cannot permanently store + the result, so be it. */ + if (errval == EAGAIN || __builtin_expect (db->negtimeout == 0, 0)) { /* Mark the old entry as obsolete. */ if (dh != NULL) |