X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=799da0aa192105cee261392d58c53bf502f8df96;hb=afb175873e6aa10d2d4dca3572edf054968c538d;hp=12cffebc1251015f0eb387e2a2dfee8a3dffb325;hpb=b22499668a7aa63c619cb8fa8535282a38841ce9;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 12cffebc..799da0aa 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -86,7 +86,7 @@ static struct option const long_options[] = { static void version(void) { printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE, - BUILD_VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR); + VERSION, BUILD_DATE, BUILD_TIME, PROT_MAJOR, PROT_MINOR); printf("Copyright (C) 1998-2012 Ivo Timmermans, Guus Sliepen and others.\n" "See the AUTHORS file for a complete list.\n\n" "tinc comes with ABSOLUTELY NO WARRANTY. This is free software,\n" @@ -829,9 +829,12 @@ static int cmd_start(int argc, char *argv[]) { nargv[nargc++] = argv[i]; #ifdef HAVE_MINGW - execvp(c, nargv); - fprintf(stderr, "Error starting %s: %s\n", c, strerror(errno)); - return 1; + int status = spawnvp(_P_WAIT, c, nargv); + if (status == -1) { + fprintf(stderr, "Error starting %s: %s\n", c, strerror(errno)); + return 1; + } + return status; #else pid_t pid = fork(); if(pid == -1) {