diff options
Diffstat (limited to 'nscd/grpcache.c')
-rw-r--r-- | nscd/grpcache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nscd/grpcache.c b/nscd/grpcache.c index d25d8e9..a26548c 100644 --- a/nscd/grpcache.c +++ b/nscd/grpcache.c @@ -75,6 +75,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, const void *key, struct group *grp, uid_t owner, struct hashentry *const he, struct datahead *dh, int errval) { + bool all_written = true; ssize_t total; ssize_t written; time_t t = time (NULL); @@ -342,6 +343,9 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, # endif #endif written = writeall (fd, &dataset->resp, dataset->head.recsize); + + if (written != dataset->head.recsize) + all_written = false; } /* Add the record to the database. But only if it has not been @@ -401,7 +405,7 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, } } - if (__builtin_expect (written != total, 0) && debug_level > 0) + if (__builtin_expect (!all_written, 0) && debug_level > 0) { char buf[256]; dbg_log (_("short write in %s: %s"), __FUNCTION__, |