X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=4357d4a0e2209cdddadc28d13f0765d237ae65e1;hb=fb5b260190b1c6d07ec822154094aee7416f292e;hp=93bb465ce874309061b67f905b4abcd4021bd8b1;hpb=5bc957074a35e58f49cbcf8d1fb5d6237d37363d;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 93bb465c..4357d4a0 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -38,12 +38,6 @@ static bool show_help = false; /* If nonzero, print the version on standard output and exit. */ static bool show_version = false; -/* If nonzero, it will attempt to kill a running tincd and exit. */ -static int kill_tincd = 0; - -/* If nonzero, generate public/private keypair for this host/net. */ -static int generate_keys = 0; - static char *name = NULL; static char *identname = NULL; /* program name for syslog */ static char *controlcookiename = NULL; /* cookie file location */ @@ -156,7 +150,6 @@ FILE *ask_and_open(const char *filename, const char *what, const char *mode) { char *directory; char buf[PATH_MAX]; char buf2[PATH_MAX]; - size_t len; /* Check stdin and stdout */ if(isatty(0) && isatty(1)) { @@ -171,7 +164,7 @@ FILE *ask_and_open(const char *filename, const char *what, const char *mode) { return NULL; } - len = strlen(buf); + size_t len = strlen(buf); if(len) buf[--len] = 0; @@ -494,7 +487,7 @@ int main(int argc, char *argv[], char *envp[]) { fprintf(stderr, "Could not open control socket cookie file %s: %s\n", controlcookiename, strerror(errno)); return 1; } - if(fscanf(f, "%1024s %128s %d", controlcookie, port, &pid) != 3) { + if(fscanf(f, "%1024s %128s %20d", controlcookie, port, &pid) != 3) { fprintf(stderr, "Could not parse control socket cookie file %s\n", controlcookiename); return 1; } @@ -535,8 +528,7 @@ int main(int argc, char *argv[], char *envp[]) { #endif if(connect(fd, res->ai_addr, res->ai_addrlen) < 0) { - - fprintf(stderr, "Cannot connect to %s: %s\n", controlcookiename, sockstrerror(sockerrno)); + fprintf(stderr, "Cannot connect to %s port %s: %s\n", host ?: "localhost", port, sockstrerror(sockerrno)); return 1; }