summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2012-02-19 02:03:11 +0000
committerroot <root>2012-02-19 02:03:11 +0000
commit4cac0415119528257f8e002346a7c5a8a0893bbf (patch)
treeb0e76fc411c2c93431a32444893b31f77859a523
parentda701b874dce05b1fd0b3e9144b10891b7570016 (diff)
*** empty log message ***
-rw-r--r--ev_win32.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ev_win32.c b/ev_win32.c
index 338886e..9217af5 100644
--- a/ev_win32.c
+++ b/ev_win32.c
@@ -48,6 +48,16 @@
/* for the crt to do something about it */
volatile double SIGFPE_REQ = 0.0f;
+static SOCKET
+ev_tcp_socket (void)
+{
+#if EV_USE_WSASOCKET
+ return WSASocket (AF_INET, SOCK_STREAM, 0, 0, 0, 0);
+#else
+ return socket (AF_INET, SOCK_STREAM, 0);
+#endif
+}
+
/* oh, the humanity! */
static int
ev_pipe (int filedes [2])
@@ -59,7 +69,7 @@ ev_pipe (int filedes [2])
SOCKET listener;
SOCKET sock [2] = { -1, -1 };
- if ((listener = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
+ if ((listener = ev_tcp_socket ()) == INVALID_SOCKET)
return -1;
addr.sin_family = AF_INET;
@@ -75,7 +85,7 @@ ev_pipe (int filedes [2])
if (listen (listener, 1))
goto fail;
- if ((sock [0] = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
+ if ((sock [0] = ev_tcp_socket ()) == INVALID_SOCKET)
goto fail;
if (connect (sock [0], (struct sockaddr *)&addr, addr_size))