X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Ftincctl.c;h=f4379b7f8ebbe6dce5de0cdb42f5321e47d4599b;hb=f704304823df0ac868786ac89355eda38592dc3f;hp=12cffebc1251015f0eb387e2a2dfee8a3dffb325;hpb=b22499668a7aa63c619cb8fa8535282a38841ce9;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 12cffebc..f4379b7f 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -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) {