From 18cb5432ff8d12065d091b8a0b4508d5734742ae Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 3 Nov 2014 09:49:03 +0000 Subject: [PATCH] connection: Fix sendmsg() on FreeBSD It expects ((msg_controllen == 0) == (msg_control == NULL)), and returns EINVAL otherwise. It can't hurt to be tidy about things on other platforms either though. See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=99356#c5 Signed-off-by: Philip Withnall Signed-off-by: Karsten Otto Reviewed-by: Pekka Paalanen --- src/connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index f2928536..1e271c42 100644 --- a/src/connection.c +++ b/src/connection.c @@ -287,7 +287,7 @@ wl_connection_flush(struct wl_connection *connection) msg.msg_namelen = 0; msg.msg_iov = iov; msg.msg_iovlen = count; - msg.msg_control = cmsg; + msg.msg_control = (clen > 0) ? cmsg : NULL; msg.msg_controllen = clen; msg.msg_flags = 0;