diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-07-22 13:43:39 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2011-07-22 13:43:39 +0000 |
commit | c837cf0bbdd09079d64188bf0028bb21df2faec7 (patch) | |
tree | d3ead9b4b8d60f25f78b12417b2ba02f14971704 /libc/nscd/grpcache.c | |
parent | a63bdad03a9963d53373008e78fc29ee48f161af (diff) |
Merge changes between 14282 and r14661 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@14662 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/nscd/grpcache.c')
-rw-r--r-- | libc/nscd/grpcache.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libc/nscd/grpcache.c b/libc/nscd/grpcache.c index fa2192901..8a2f80ccd 100644 --- a/libc/nscd/grpcache.c +++ b/libc/nscd/grpcache.c @@ -114,13 +114,18 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, case. */ total = sizeof (notfound); - written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, - MSG_NOSIGNAL)); + if (fd != -1) + written = TEMP_FAILURE_RETRY (send (fd, ¬found, total, + MSG_NOSIGNAL)); - dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, - 1); /* If we cannot permanently store the result, so be it. */ - if (dataset != NULL) + if (db->negtimeout == 0) + { + /* Mark the old entry as obsolete. */ + if (dh != NULL) + dh->usable = false; + } + else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL) { dataset->head.allocsize = sizeof (struct dataset) + req->key_len; dataset->head.recsize = total; |