aboutsummaryrefslogtreecommitdiff
path: root/nscd/initgrcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/initgrcache.c')
-rw-r--r--nscd/initgrcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
index c33aaf3..8195b66 100644
--- a/nscd/initgrcache.c
+++ b/nscd/initgrcache.c
@@ -350,14 +350,14 @@ addinitgroupsX (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
+ assert ((char *) dataset - (char *) db->head
+ total
<= (sizeof (struct database_pers_head)
+ db->head->module * sizeof (ref_t)
+ db->head->data_size));
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;
@@ -368,7 +368,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
use_write:
# endif
#endif
- written = writeall (fd, &dataset->resp, total);
+ written = writeall (fd, &dataset->resp, dataset->head.recsize);
}