Fix the check for sys/un.h.
[tinc] / src / fd_device.c
index 5cfe75f..49d4a3c 100644 (file)
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
+#include "system.h"
+
+#ifdef HAVE_SYS_UN_H
 #include <sys/un.h>
 
-#include "system.h"
 #include "conf.h"
 #include "device.h"
 #include "ethernet.h"
@@ -83,7 +85,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!",
-                      (unsigned long)cmsgptr->cmsg_len, CMSG_LEN(sizeof(device_fd)));
+                      (unsigned long)cmsgptr->cmsg_len, (unsigned long)CMSG_LEN(sizeof(device_fd)));
                return -1;
        }
 
@@ -234,3 +236,4 @@ const devops_t fd_devops = {
        .read = read_packet,
        .write = write_packet,
 };
+#endif