about summary refs log tree commit diff
path: root/nscd
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-07-14 02:17:58 +0000
committerUlrich Drepper <drepper@redhat.com>2005-07-14 02:17:58 +0000
commita08ab89700a4a2e60c4c99df5b23960427e19eeb (patch)
treef7b8c5e14ac2549cead4deec12802316937a9ea3 /nscd
parent7529e67ed84e9af2fcfec3eca1f0e18ece7e5475 (diff)
downloadglibc-a08ab89700a4a2e60c4c99df5b23960427e19eeb.tar.gz
glibc-a08ab89700a4a2e60c4c99df5b23960427e19eeb.tar.xz
glibc-a08ab89700a4a2e60c4c99df5b23960427e19eeb.zip
* nscd/connections.c (send_ro_fd): Make sure BUF is aligned correctly.
Diffstat (limited to 'nscd')
-rw-r--r--nscd/connections.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nscd/connections.c b/nscd/connections.c
index 8179cb237d..9dc852a1df 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -604,9 +604,14 @@ send_ro_fd (struct database_dyn *db, char *key, int fd)
   iov[0].iov_len = strlen (key) + 1;
 
   /* 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,
-			.msg_control = buf, .msg_controllen = sizeof (buf) };
+			.msg_control = buf.bytes,
+			.msg_controllen = sizeof (buf) };
   struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
 
   cmsg->cmsg_level = SOL_SOCKET;