projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d0e866
)
check for daemon pid existence before trying to connect to the control socket, and...
author
Sean McVeigh
<sean@vger.beerbot.ca>
Sat, 21 May 2016 21:25:18 +0000
(17:25 -0400)
committer
Sean McVeigh
<sean@vger.beerbot.ca>
Sat, 21 May 2016 21:25:18 +0000
(17:25 -0400)
src/tincctl.c
patch
|
blob
|
history
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
e42ec2c
..
39a11d3
100644
(file)
--- 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;