mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
* nscd/connections.c (send_ro_fd): Make sure BUF is aligned correctly.
This commit is contained in:
parent
7529e67ed8
commit
a08ab89700
@ -1,5 +1,6 @@
|
|||||||
2005-07-13 Ulrich Drepper <drepper@redhat.com>
|
2005-07-13 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* nscd/connections.c (send_ro_fd): Make sure BUF is aligned correctly.
|
||||||
* nscd/nscd_helper.c (wait_on_socket): New function.
|
* nscd/nscd_helper.c (wait_on_socket): New function.
|
||||||
(get_mapping): Use wait_on_socket instead of poll. The former handles
|
(get_mapping): Use wait_on_socket instead of poll. The former handles
|
||||||
EINTR of poll correctly.
|
EINTR of poll correctly.
|
||||||
|
@ -604,9 +604,14 @@ send_ro_fd (struct database_dyn *db, char *key, int fd)
|
|||||||
iov[0].iov_len = strlen (key) + 1;
|
iov[0].iov_len = strlen (key) + 1;
|
||||||
|
|
||||||
/* Prepare the control message to transfer the descriptor. */
|
/* Prepare the control message to transfer the descriptor. */
|
||||||
char buf[CMSG_SPACE (sizeof (int))];
|
union
|
||||||
|
{
|
||||||
|
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 = 1,
|
||||||
.msg_control = buf, .msg_controllen = sizeof (buf) };
|
.msg_control = buf.bytes,
|
||||||
|
.msg_controllen = sizeof (buf) };
|
||||||
struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
|
struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
|
||||||
|
|
||||||
cmsg->cmsg_level = SOL_SOCKET;
|
cmsg->cmsg_level = SOL_SOCKET;
|
||||||
|
Loading…
Reference in New Issue
Block a user