Commit f58c709b authored by Mike Kaplinskiy's avatar Mike Kaplinskiy Committed by Alexandre Julliard

server: Fix connect failures on newer kernels.

parent a6de06aa
...@@ -4026,7 +4026,7 @@ static void test_ConnectEx(void) ...@@ -4026,7 +4026,7 @@ static void test_ConnectEx(void)
closesocket(listener); closesocket(listener);
listener = INVALID_SOCKET; listener = INVALID_SOCKET;
address.sin_port = 1; address.sin_port = htons(1);
bret = pConnectEx(connector, (struct sockaddr*)&address, addrlen, NULL, 0, &bytesReturned, &overlapped); bret = pConnectEx(connector, (struct sockaddr*)&address, addrlen, NULL, 0, &bytesReturned, &overlapped);
ok(bret == FALSE && GetLastError(), "ConnectEx to bad destination failed: " ok(bret == FALSE && GetLastError(), "ConnectEx to bad destination failed: "
......
...@@ -388,18 +388,18 @@ static void sock_poll_event( struct fd *fd, int event ) ...@@ -388,18 +388,18 @@ static void sock_poll_event( struct fd *fd, int event )
if (sock->state & FD_CONNECT) if (sock->state & FD_CONNECT)
{ {
/* connecting */ if (event & (POLLERR|POLLHUP))
if (event & POLLOUT)
{ {
/* we got connected */ /* we didn't get connected? */
sock->state |= FD_WINE_CONNECTED|FD_READ|FD_WRITE;
sock->state &= ~FD_CONNECT; sock->state &= ~FD_CONNECT;
event &= ~POLLOUT;
error = sock_error( fd );
} }
else if (event & (POLLERR|POLLHUP)) else if (event & POLLOUT)
{ {
/* we didn't get connected? */ /* we got connected */
sock->state |= FD_WINE_CONNECTED|FD_READ|FD_WRITE;
sock->state &= ~FD_CONNECT; sock->state &= ~FD_CONNECT;
error = sock_error( fd );
} }
} }
else if (sock->state & FD_WINE_LISTENING) else if (sock->state & FD_WINE_LISTENING)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment