diff options
Diffstat (limited to 'nscd/hstcache.c')
-rw-r--r-- | nscd/hstcache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nscd/hstcache.c b/nscd/hstcache.c index 3e8c370b70..c7cdc4deb4 100644 --- a/nscd/hstcache.c +++ b/nscd/hstcache.c @@ -200,7 +200,7 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key, /* We write the dataset before inserting it to the database since while inserting this thread might block and so would unnecessarily let the receiver wait. */ - written = write (fd, data, total); + written = TEMP_FAILURE_RETRY (write (fd, data, total)); addr_list_type = (hst->h_length == NS_INADDRSZ ? GETHOSTBYADDR : GETHOSTBYADDRv6); @@ -272,7 +272,7 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key, pthread_rwlock_unlock (&db->lock); } - if (written != total && debug_level > 0) + if (__builtin_expect (written != total, 0) && debug_level > 0) { char buf[256]; dbg_log (_("short write in %s: %s"), __FUNCTION__, |