diff options
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/grpcache.c | 5 | ||||
-rw-r--r-- | nscd/servicescache.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/nscd/grpcache.c b/nscd/grpcache.c index fa21929014..0e7f81f535 100644 --- a/nscd/grpcache.c +++ b/nscd/grpcache.c @@ -114,8 +114,9 @@ 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); diff --git a/nscd/servicescache.c b/nscd/servicescache.c index 2dd1cc5675..b0a2977935 100644 --- a/nscd/servicescache.c +++ b/nscd/servicescache.c @@ -104,8 +104,9 @@ cache_addserv (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); |