X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=da66c8ffb441d931810c643cf887613689fefc6e;hb=0c026f3c6dec784c3267ad7e2c4709d5393dc292;hp=9fc749bcfc9fb76934f9f47303ec3336976269fa;hpb=31c68993989fbca3c88df1449ea2077baafce481;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 9fc749bc..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; }