X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsptps_test.c;h=baca66b318f7e3c23d8ff181cd5532bac0191b07;hb=ee988a6e3758994cb0552ef17f872e2530e7ceff;hp=0f62af01dbaf318f559597aaa14b1da3c53a457f;hpb=28b7a53b693f6b4e70218a926e68a36ece54cda1;p=tinc diff --git a/src/sptps_test.c b/src/sptps_test.c index 0f62af01..baca66b3 100644 --- a/src/sptps_test.c +++ b/src/sptps_test.c @@ -25,7 +25,7 @@ #include -#ifdef HAVE_MINGW +#ifdef HAVE_WINDOWS #include #endif @@ -35,8 +35,9 @@ #include "protocol.h" #include "sptps.h" #include "utils.h" +#include "names.h" -#ifndef HAVE_MINGW +#ifndef HAVE_WINDOWS #define closesocket(s) close(s) #endif @@ -56,7 +57,6 @@ bool send_meta(struct connection_t *c, const void *msg, size_t len) { return false; } -char *logfilename = NULL; bool do_detach = false; struct timeval now; @@ -136,8 +136,6 @@ static struct option const long_options[] = { {NULL, 0, NULL, 0} }; -const char *program_name; - static void usage(void) { static const char *message = "Usage: %s [options] my_ed25519_key_file his_ed25519_key_file [host] port\n" @@ -162,7 +160,7 @@ static void usage(void) { fprintf(stderr, message, program_name); } -#ifdef HAVE_MINGW +#ifdef HAVE_WINDOWS int stdin_sock_fd = -1; @@ -310,7 +308,7 @@ server_err: return -1; } -#endif // HAVE_MINGW +#endif // HAVE_WINDOWS int main(int argc, char *argv[]) { program_name = argv[0]; @@ -430,7 +428,7 @@ int main(int argc, char *argv[]) { #endif -#ifdef HAVE_MINGW +#ifdef HAVE_WINDOWS static struct WSAData wsa_state; if(WSAStartup(MAKEWORD(2, 2), &wsa_state)) { @@ -568,7 +566,7 @@ int main(int argc, char *argv[]) { return 1; } -#ifdef HAVE_MINGW +#ifdef HAVE_WINDOWS if(!readonly) { in = start_input_reader(); @@ -609,7 +607,7 @@ int main(int argc, char *argv[]) { } if(FD_ISSET(in, &fds)) { -#ifdef HAVE_MINGW +#ifdef HAVE_WINDOWS ssize_t len = recv(in, buf, readsize, 0); #else ssize_t len = read(in, buf, readsize); @@ -623,7 +621,7 @@ int main(int argc, char *argv[]) { } if(len == 0) { -#ifdef HAVE_MINGW +#ifdef HAVE_WINDOWS shutdown(in, SD_SEND); closesocket(in); #endif