diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-07-07 16:01:34 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-07-07 16:01:34 +0300 |
commit | 61008a7c0b45fe55f3f611c61f81e569e6baee30 (patch) | |
tree | 4625f1c9ee946a0222f16dfe0ad7a298b3d91812 /src/nxt_socketpair.c | |
parent | 264ae98d49c15e068e5ace88578856bbeb901b82 (diff) | |
download | unit-61008a7c0b45fe55f3f611c61f81e569e6baee30.tar.gz unit-61008a7c0b45fe55f3f611c61f81e569e6baee30.tar.bz2 |
Cosmetic changes to remove some annoying valgrind messages.
Diffstat (limited to 'src/nxt_socketpair.c')
-rw-r--r-- | src/nxt_socketpair.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nxt_socketpair.c b/src/nxt_socketpair.c index e1c303dd..efa0f486 100644 --- a/src/nxt_socketpair.c +++ b/src/nxt_socketpair.c @@ -188,6 +188,10 @@ nxt_sendmsg(nxt_socket_t s, nxt_fd_t fd, nxt_iobuf_t *iob, nxt_uint_t niob) msg.msg_control = (caddr_t) &cmsg; msg.msg_controllen = sizeof(cmsg); +#if (NXT_VALGRIND) + nxt_memzero(&cmsg, sizeof(cmsg)); +#endif + cmsg.cm.cmsg_len = CMSG_LEN(sizeof(int)); cmsg.cm.cmsg_level = SOL_SOCKET; cmsg.cm.cmsg_type = SCM_RIGHTS; @@ -231,6 +235,10 @@ nxt_recvmsg(nxt_socket_t s, nxt_fd_t *fd, nxt_iobuf_t *iob, nxt_uint_t niob) *fd = -1; +#if (NXT_VALGRIND) + nxt_memzero(&cmsg, sizeof(cmsg)); +#endif + n = recvmsg(s, &msg, 0); if (n > 0 |