summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/unix/stream.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-15 14:43:50 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-15 14:43:50 (GMT)
commited17516b31404dd42eab61c599c84933af485b34 (patch)
tree52538b48c172c7258117b1edcee4359dcf6c45e5 /Utilities/cmlibuv/src/unix/stream.c
parent52fbae0a59d05f2724e77aff75c7761b685bae03 (diff)
parent12a78bc824655524d817508d6107ef4dcf8e3626 (diff)
downloadCMake-ed17516b31404dd42eab61c599c84933af485b34.zip
CMake-ed17516b31404dd42eab61c599c84933af485b34.tar.gz
CMake-ed17516b31404dd42eab61c599c84933af485b34.tar.bz2
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv: libuv 2017-05-09 (e11dcd43) Fixes: #16878
Diffstat (limited to 'Utilities/cmlibuv/src/unix/stream.c')
-rw-r--r--Utilities/cmlibuv/src/unix/stream.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Utilities/cmlibuv/src/unix/stream.c b/Utilities/cmlibuv/src/unix/stream.c
index 7059df1..dbd04f2 100644
--- a/Utilities/cmlibuv/src/unix/stream.c
+++ b/Utilities/cmlibuv/src/unix/stream.c
@@ -785,7 +785,12 @@ start:
struct msghdr msg;
struct cmsghdr *cmsg;
int fd_to_send = uv__handle_fd((uv_handle_t*) req->send_handle);
- char scratch[64] = {0};
+ union {
+ char data[64];
+ struct cmsghdr alias;
+ } scratch;
+
+ memset(&scratch, 0, sizeof(scratch));
assert(fd_to_send >= 0);
@@ -795,7 +800,7 @@ start:
msg.msg_iovlen = iovcnt;
msg.msg_flags = 0;
- msg.msg_control = (void*) scratch;
+ msg.msg_control = &scratch.alias;
msg.msg_controllen = CMSG_SPACE(sizeof(fd_to_send));
cmsg = CMSG_FIRSTHDR(&msg);