}
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;
return 1;
}
- if(!connect_tincd(true) && !pid)
+ if(!connect_tincd(true) || !pid)
return 1;
printf("%d\n", pid);
}
*newline++ = '\0';
+ size_t skip = newline - data;
char signer[MAX_STRING_SIZE] = "";
char sig[MAX_STRING_SIZE] = "";
memcpy(data + len, trailer, trailer_len);
free(trailer);
+ newline = data + skip;
+
char fname[PATH_MAX];
snprintf(fname, sizeof fname, "%s" SLASH "hosts" SLASH "%s", confbase, node);
FILE *fp = fopen(fname, "r");