s3:messaging: protect use of msg_control with HAVE_STRUCT_MSGHDR_MSG_CONTROL
authorMichael Adam <obnox@samba.org>
Sat, 31 May 2014 10:16:08 +0000 (12:16 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 2 Jun 2014 23:14:17 +0000 (01:14 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun  3 01:14:17 CEST 2014 on sn-devel-104

source3/lib/unix_msg/unix_msg.c

index bcabd28da284304bc9e1724acbf247099cc95525..602ecc63f6f65a541d9d0dc971cf493f83b92f12 100644 (file)
@@ -244,8 +244,10 @@ static void unix_dgram_recv_handler(struct poll_watch *w, int fd, short events,
        msg = (struct msghdr) {
                .msg_iov = &iov,
                .msg_iovlen = 1,
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
                .msg_control = NULL,
                .msg_controllen = 0,
+#endif
        };
 
        received = recvmsg(fd, &msg, 0);
@@ -509,8 +511,10 @@ static int unix_dgram_send(struct unix_dgram_ctx *ctx, const char *dst_sock,
        msg.msg_namelen = sizeof(addr);
        msg.msg_iov = discard_const_p(struct iovec, iov);
        msg.msg_iovlen = iovlen;
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
        msg.msg_control = NULL;
        msg.msg_controllen = 0;
+#endif
        msg.msg_flags = 0;
 
        ret = sendmsg(ctx->sock, &msg, 0);