X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=5ae76d31524baadef5781ff21388caaf3c81769e;hb=b9a7444b9fa216d16d91f34d2e12f51fc4d60e46;hp=c700f947779c7251d96e913a8391b11d36c2c742;hpb=ccbe79c03b8c64432bbf1ce82dc0e123cc02bd6d;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index c700f947..5ae76d31 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -644,7 +644,7 @@ static bool stop_tincd(void) { // wait for tincd to close the connection... } - close(fd); + closesocket(fd); pid = 0; fd = -1; @@ -717,7 +717,7 @@ bool connect_tincd(bool verbose) { if(select(fd + 1, &r, NULL, NULL, &tv)) { fprintf(stderr, "Previous connection to tincd lost, reconnecting.\n"); - close(fd); + closesocket(fd); fd = -1; } else { return true; @@ -784,7 +784,7 @@ bool connect_tincd(bool verbose) { fprintf(stderr, "Cannot connect to UNIX socket %s: %s\n", unixsocketname, sockstrerror(sockerrno)); } - close(fd); + closesocket(fd); fd = -1; return false; } @@ -830,7 +830,7 @@ bool connect_tincd(bool verbose) { fprintf(stderr, "Cannot connect to %s port %s: %s\n", host, port, sockstrerror(sockerrno)); } - close(fd); + closesocket(fd); fd = -1; return false; } @@ -853,7 +853,7 @@ bool connect_tincd(bool verbose) { fprintf(stderr, "Cannot read greeting from control socket: %s\n", sockstrerror(sockerrno)); } - close(fd); + closesocket(fd); fd = -1; return false; } @@ -863,7 +863,7 @@ bool connect_tincd(bool verbose) { fprintf(stderr, "Could not fully establish control socket connection\n"); } - close(fd); + closesocket(fd); fd = -1; return false; } @@ -1528,7 +1528,7 @@ static int cmd_log(int argc, char *argv[]) { signal(SIGINT, SIG_DFL); #endif - close(fd); + closesocket(fd); fd = -1; return 0; } @@ -2623,7 +2623,7 @@ static int switch_network(char *name) { } if(fd >= 0) { - close(fd); + closesocket(fd); fd = -1; }