X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Ftincctl.c;h=39a11d314a84aa849327c55e36b98ffc5abea106;hp=e42ec2cc81ccebb72709dac737856c5bdb64cfb8;hb=4314df644e22778a554ca1760941a2bfae08bce2;hpb=9d0e86683cdb7d53263569ad2e49dd87bd217939 diff --git a/src/tincctl.c b/src/tincctl.c index e42ec2cc..39a11d31 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -718,6 +718,13 @@ bool connect_tincd(bool verbose) { } fclose(f); + if ((pid == 0) || (kill(pid, 0) && (errno == ESRCH))) { + fprintf(stderr, "Could not find tincd running at pid %d\n", pid); + /* clean up the stale socket and pid file */ + unlink(pidfilename); + unlink(unixsocketname); + return false; + } #ifndef HAVE_MINGW struct sockaddr_un sa;