From: Michael Jeanson Date: Wed, 14 Oct 2015 18:55:14 +0000 (-0400) Subject: Port: move memset of anc_buf inside ifdef X-Git-Tag: v2.8.0-rc1~282 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8bbffd547a5d7ce11413aff2082f97aafe9d7a51;p=lttng-tools.git Port: move memset of anc_buf inside ifdef Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/sessiond-comm/unix.c b/src/common/sessiond-comm/unix.c index 77a6013f0..e2d0def8e 100644 --- a/src/common/sessiond-comm/unix.c +++ b/src/common/sessiond-comm/unix.c @@ -396,10 +396,11 @@ ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len) size_t sizeof_cred = sizeof(lttng_sock_cred); char anc_buf[CMSG_SPACE(sizeof_cred)]; lttng_sock_cred *creds; + + memset(anc_buf, 0, CMSG_SPACE(sizeof_cred) * sizeof(char)); #endif /* __linux__ */ memset(&msg, 0, sizeof(msg)); - memset(anc_buf, 0, CMSG_SPACE(sizeof_cred) * sizeof(char)); iov[0].iov_base = buf; iov[0].iov_len = len;