X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ffd_device.c;h=381c7841df905a3ecf1bcbe97d2ad078564ff113;hb=28be4baae016a5a771d0d9ec6e97ef38a4fc9e46;hp=7360d17e7964da2b669b254970edb044f7416d4e;hpb=2c6b2d70e6640f39563ad7bb0aa0ba87f883848c;p=tinc diff --git a/src/fd_device.c b/src/fd_device.c index 7360d17e..381c7841 100644 --- a/src/fd_device.c +++ b/src/fd_device.c @@ -1,7 +1,7 @@ /* fd_device.c -- Interaction with Android tun fd Copyright (C) 2001-2005 Ivo Timmermans, - 2001-2021 Guus Sliepen + 2001-2022 Guus Sliepen 2009 Grzegorz Dymarek 2016-2020 Pacien TRAN-GIRARD @@ -22,7 +22,6 @@ #include "system.h" -#ifdef HAVE_SYS_UN_H #include #include "conf.h" @@ -53,7 +52,7 @@ static int read_fd(int socket) { msg.msg_controllen = sizeof(cmsgbuf); if((ret = recvmsg(socket, &msg, 0)) < 1) { - logger(DEBUG_ALWAYS, LOG_ERR, "Could not read from unix socket (error %zd)!", ret); + logger(DEBUG_ALWAYS, LOG_ERR, "Could not read from unix socket (error %ld)!", (long)ret); return -1; } @@ -83,8 +82,8 @@ static int read_fd(int socket) { } if(cmsgptr->cmsg_len != CMSG_LEN(sizeof(device_fd))) { - logger(DEBUG_ALWAYS, LOG_ERR, "Wrong CMSG data length: %zu, expected %zu!", - 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, (unsigned long)CMSG_LEN(sizeof(device_fd))); return -1; } @@ -150,7 +149,7 @@ static bool setup_device(void) { return false; } - if(!get_config_string(lookup_config(config_tree, "Device"), &device)) { + if(!get_config_string(lookup_config(&config_tree, "Device"), &device)) { logger(DEBUG_ALWAYS, LOG_ERR, "Could not read device from configuration!"); return false; } @@ -240,4 +239,3 @@ const devops_t fd_devops = { .read = read_packet, .write = write_packet, }; -#endif