aboutsummaryrefslogtreecommitdiff
path: root/nscd/aicache.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/aicache.c')
-rw-r--r--nscd/aicache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nscd/aicache.c b/nscd/aicache.c
index 524c0a63af..992357d2fe 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -453,13 +453,13 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
{
assert (db->wr_fd != -1);
assert ((char *) &dataset->resp > (char *) db->data);
- assert ((char *) &dataset->resp - (char *) db->head + total
+ assert ((char *) dataset - (char *) db->head + total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
ssize_t written;
written = sendfileall (fd, db->wr_fd, (char *) &dataset->resp
- - (char *) db->head, total);
+ - (char *) db->head, dataset->head.recsize);
# ifndef __ASSUME_SENDFILE
if (written == -1 && errno == ENOSYS)
goto use_write;
@@ -470,7 +470,7 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
use_write:
# endif
#endif
- writeall (fd, &dataset->resp, total);
+ writeall (fd, &dataset->resp, dataset->head.recsize);
}
goto out;