X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet_setup.c;h=f26007bda07ff27d248f98166f0133fce2a2e8e3;hp=5eddb1a76c3f2d7d04152cd72a4716e720cc9491;hb=b1b5cbc597088393e25d633e76d6456c7572e06c;hpb=046616019def745aeeba3f553cda503affee1e86 diff --git a/src/net_setup.c b/src/net_setup.c index 5eddb1a7..f26007bd 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "avl_tree.h" #include "conf.h" @@ -239,7 +240,7 @@ static bool read_rsa_private_key(void) { return false; } -#if !defined(HAVE_MINGW) && !defined(HAVE___CYGWIN32__) +#if !defined(HAVE_MINGW) && !defined(HAVE_CYGWIN) struct stat s; if(!fstat(fileno(fp), &s)) { @@ -388,8 +389,8 @@ static bool setup_myself(void) { char *address = NULL; char *proxy = NULL; char *space; - char *envp[5] = {}; - struct addrinfo *ai, *aip, hint = {}; + char *envp[5] = {0}; + struct addrinfo *ai, *aip, hint = {0}; bool choice; int i, err; int replaywin_int; @@ -852,15 +853,15 @@ static bool setup_myself(void) { } /* Run tinc-up script to further initialize the tap interface */ - xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); xasprintf(&envp[3], "NAME=%s", myself->name); #ifdef HAVE_MINGW Sleep(1000); #endif -#ifdef HAVE___CYGWIN32__ +#ifdef HAVE_CYGWIN sleep(1); #endif execute_script("tinc-up", envp); @@ -1068,7 +1069,7 @@ bool setup_network(void) { void close_network_connections(void) { avl_node_t *node, *next; connection_t *c; - char *envp[5] = {}; + char *envp[5] = {0}; int i; for(node = connection_tree->head; node; node = next) { @@ -1099,9 +1100,9 @@ void close_network_connections(void) { close(listen_socket[i].udp); } - xasprintf(&envp[0], "NETNAME=%s", netname ? : ""); - xasprintf(&envp[1], "DEVICE=%s", device ? : ""); - xasprintf(&envp[2], "INTERFACE=%s", iface ? : ""); + xasprintf(&envp[0], "NETNAME=%s", netname ? netname : ""); + xasprintf(&envp[1], "DEVICE=%s", device ? device : ""); + xasprintf(&envp[2], "INTERFACE=%s", iface ? iface : ""); xasprintf(&envp[3], "NAME=%s", myself->name); exit_requests();