aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-09-07 03:22:47 +0000
committerdos-reis <gdr@axiomatics.org>2008-09-07 03:22:47 +0000
commit613fcc4c78d3bfe974754f1d3b0ebd5bbf2e5622 (patch)
tree9ac841262977940eeb0e7467c8d2c58a3129ac84 /src/lib
parent6fc0c760fe21ecdef6180c8b3bc3d7a198b3a398 (diff)
downloadopen-axiom-613fcc4c78d3bfe974754f1d3b0ebd5bbf2e5622.tar.gz
Fix compilation failure on MinGW.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/sockio-c.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/sockio-c.c b/src/lib/sockio-c.c
index d9bc240c..912e16a9 100644
--- a/src/lib/sockio-c.c
+++ b/src/lib/sockio-c.c
@@ -320,14 +320,16 @@ oa_open_ip4_client_stream_socket(const char* addr, openaxiom_port port)
return OPENAXIOM_INVALID_SOCKET;
memset(&server, 0, sizeof server);
server.sin_family = AF_INET;
+#ifdef __WIN32__
+ if ((server.sin_addr.s_addr = inet_addr(addr)) == INADDR_NONE) {
+#else
if (inet_pton(AF_INET, addr, &server.sin_addr) <= 0) {
- fflush(stderr);
+#endif
oa_close_socket(sock);
return OPENAXIOM_INVALID_SOCKET;
}
server.sin_port = htons(port);
if (connect(sock, (struct sockaddr*)&server, sizeof server) < 0) {
- fflush(stderr);
oa_close_socket(sock);
return OPENAXIOM_INVALID_SOCKET;
}