X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=da66c8ffb441d931810c643cf887613689fefc6e;hb=313a752cb5fbf27450d34c15b0085d2d8a4147af;hp=73b998a586c73f2a697d1740c17e4cb6b60df8c0;hpb=1ce0f7613964c7441ef683f9d875dd09cbfd667c;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 73b998a5..da66c8ff 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -485,7 +485,7 @@ bool recvline(int fd, char *line, size_t len) { while(!(newline = memchr(buffer, '\n', blen))) { int result = recv(fd, buffer + blen, sizeof buffer - blen, 0); - if(result == -1 && errno == EINTR) + if(result == -1 && sockerrno == EINTR) continue; else if(result <= 0) return false; @@ -511,7 +511,7 @@ bool recvdata(int fd, char *data, size_t len) { while(blen < len) { int result = recv(fd, buffer + blen, sizeof buffer - blen, 0); - if(result == -1 && errno == EINTR) + if(result == -1 && sockerrno == EINTR) continue; else if(result <= 0) return false; @@ -543,7 +543,7 @@ bool sendline(int fd, char *format, ...) { while(blen) { int result = send(fd, p, blen, MSG_NOSIGNAL); - if(result == -1 && errno == EINTR) + if(result == -1 && sockerrno == EINTR) continue; else if(result <= 0) return false; @@ -723,7 +723,7 @@ bool connect_tincd(bool verbose) { if(getaddrinfo(host, port, &hints, &res) || !res) { if(verbose) - fprintf(stderr, "Cannot resolve %s port %s: %s", host, port, strerror(errno)); + fprintf(stderr, "Cannot resolve %s port %s: %s", host, port, sockstrerror(sockerrno)); return false; } @@ -1626,7 +1626,7 @@ static int cmd_config(int argc, char *argv[]) { if(action < 0 && !removed) { remove(tmpfile); fprintf(stderr, "No configuration variables deleted.\n"); - return *value != 0; + return 1; } // Replace the configuration file with the new one