X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=6e7965c291b4ff95f62575cd442ac1e9ad918216;hb=2cd8e2b8e8d60fdeb633afe54eaf38e18afb04dc;hp=55e14e53657dcacb3b835a64c0907394445790a9;hpb=a38e0d621397d6d69c939ccc287d5a803b668195;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 55e14e53..6e7965c2 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -39,12 +39,6 @@ #include "tincctl.h" #include "top.h" -#ifdef HAVE_MINGW -#define SCRIPTEXTENSION ".bat" -#else -#define SCRIPTEXTENSION "" -#endif - static char **orig_argv; static int orig_argc; @@ -71,10 +65,8 @@ static bool force = false; bool tty = true; bool confbasegiven = false; bool netnamegiven = false; - -#ifdef HAVE_MINGW -static struct WSAData wsa_state; -#endif +char *scriptinterpreter = NULL; +char *scriptextension = ""; static struct option const long_options[] = { {"config", required_argument, NULL, 'c'}, @@ -686,14 +678,6 @@ bool connect_tincd(bool verbose) { fclose(f); -#ifdef HAVE_MINGW - if(WSAStartup(MAKEWORD(2, 2), &wsa_state)) { - if(verbose) - fprintf(stderr, "System call `%s' failed: %s", "WSAStartup", winerror(GetLastError())); - return false; - } -#endif - #ifndef HAVE_MINGW struct sockaddr_un sa; sa.sun_family = AF_UNIX; @@ -2370,6 +2354,15 @@ int main(int argc, char *argv[]) { return 0; } +#ifdef HAVE_MINGW + static struct WSAData wsa_state; + + if(WSAStartup(MAKEWORD(2, 2), &wsa_state)) { + fprintf(stderr, "System call `%s' failed: %s", "WSAStartup", winerror(GetLastError())); + return false; + } +#endif + srand(time(NULL)); crypto_init();