aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/lib/sockio-c.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index dc93a3c5..f7e95a38 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2008-09-06 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * lib/sockio-c.c (oa_open_ip4_client_stream_socket): Use deprecated
+ inet_addr on MinGW host.
+
+2008-09-06 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/sys-os.boot (openIP4ClientStreamSocket): New.
(readFromStreamSocket): Likewise.
(writeToStreamSocket): Likewise.
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;
}