From: leptonyu Date: Sun, 15 Mar 2020 01:39:42 +0000 (+0000) Subject: fix macos build X-Git-Tag: release-1.1pre18~20 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=d0ae7fa0162cf5b70dca1b34b42f49e94bf93a48;p=tinc fix macos build --- diff --git a/src/fd_device.c b/src/fd_device.c index 84295566..eab9e160 100644 --- a/src/fd_device.c +++ b/src/fd_device.c @@ -55,7 +55,11 @@ static int read_fd(int socket) { logger(DEBUG_ALWAYS, LOG_ERR, "Could not read from unix socket (error %d)!", ret); return -1; } +#ifdef IP_RECVERR if(msg.msg_flags & (MSG_CTRUNC | MSG_OOB | MSG_ERRQUEUE)) { +#else + if(msg.msg_flags & (MSG_CTRUNC | MSG_OOB)) { +#endif logger(DEBUG_ALWAYS, LOG_ERR, "Error while receiving message (flags %d)!", msg.msg_flags); return -1; } @@ -73,7 +77,7 @@ static int read_fd(int socket) { } if(cmsgptr->cmsg_len != CMSG_LEN(sizeof(device_fd))) { logger(DEBUG_ALWAYS, LOG_ERR, "Wrong CMSG data length: %lu, expected %lu!", - cmsgptr->cmsg_len, CMSG_LEN(sizeof(device_fd))); + (unsigned long)cmsgptr->cmsg_len, CMSG_LEN(sizeof(device_fd))); return -1; }