summaryrefslogtreecommitdiff
path: root/nscd/connections.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-08-29 06:10:07 +0000
committerUlrich Drepper <drepper@redhat.com>2007-08-29 06:10:07 +0000
commitf3c54060af56e255844545fb566b83fcd6e9e9f5 (patch)
tree7b839d47f4d0b7e2c5552d88dcd4d8c537353621 /nscd/connections.c
parent0adfcc05265f4297adb89a040acb52689f3be87c (diff)
* nscd/connections.c (send_ro_fd): Also transfer file size.
* nscd/nscd_helper.c (get_mapping): If nscd also transfers the file size don't call fstat.
Diffstat (limited to 'nscd/connections.c')
-rw-r--r--nscd/connections.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nscd/connections.c b/nscd/connections.c
index e435fa8b27..11fbc03498 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -907,9 +907,14 @@ send_ro_fd (struct database_dyn *db, char *key, int fd)
return;
/* We need to send some data along with the descriptor. */
- struct iovec iov[1];
+ uint64_t mapsize = (db->head->data_size
+ + roundup (db->head->module * sizeof (ref_t), ALIGN)
+ + sizeof (struct database_pers_head));
+ struct iovec iov[2];
iov[0].iov_base = key;
iov[0].iov_len = strlen (key) + 1;
+ iov[1].iov_base = &mapsize;
+ iov[1].iov_len = sizeof (mapsize);
/* Prepare the control message to transfer the descriptor. */
union
@@ -917,7 +922,7 @@ send_ro_fd (struct database_dyn *db, char *key, int fd)
struct cmsghdr hdr;
char bytes[CMSG_SPACE (sizeof (int))];
} buf;
- struct msghdr msg = { .msg_iov = iov, .msg_iovlen = 1,
+ struct msghdr msg = { .msg_iov = iov, .msg_iovlen = 2,
.msg_control = buf.bytes,
.msg_controllen = sizeof (buf) };
struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);