From 1233b4b27b7b9b0b3b2bbfb6a541e7f5f36659fe Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Tue, 18 Sep 2007 20:03:47 +0200 Subject: [PATCH] ws2_32/tests: Don't wait for FD_CONNECT event when non-blocking connect() was successful. --- dlls/ws2_32/tests/sock.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 7eb6d38c989..d04552e7211 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -650,17 +650,17 @@ static void WINAPI event_client ( client_params *par ) event = WSACreateEvent (); WSAEventSelect ( mem->s, event, FD_CONNECT ); tmp = connect ( mem->s, (struct sockaddr*) &mem->addr, sizeof ( mem->addr ) ); - if ( tmp != 0 && ( err = WSAGetLastError () ) != WSAEWOULDBLOCK ) - ok ( 0, "event_client (%x): connect error: %d\n", id, err ); - - tmp = WaitForSingleObject ( event, INFINITE ); - ok ( tmp == WAIT_OBJECT_0, "event_client (%x): wait for connect event failed: %d\n", id, tmp ); - err = WSAEnumNetworkEvents ( mem->s, event, &wsa_events ); - wsa_ok ( err, 0 ==, "event_client (%x): WSAEnumNetworkEvents error: %d\n" ); - - err = wsa_events.iErrorCode[ FD_CONNECT_BIT ]; - ok ( err == 0, "event_client (%x): connect error: %d\n", id, err ); - if ( err ) goto out; + if ( tmp != 0 ) { + err = WSAGetLastError (); + ok ( err == WSAEWOULDBLOCK, "event_client (%x): connect error: %d\n", id, err ); + tmp = WaitForSingleObject ( event, INFINITE ); + ok ( tmp == WAIT_OBJECT_0, "event_client (%x): wait for connect event failed: %d\n", id, tmp ); + err = WSAEnumNetworkEvents ( mem->s, event, &wsa_events ); + wsa_ok ( err, 0 ==, "event_client (%x): WSAEnumNetworkEvents error: %d\n" ); + err = wsa_events.iErrorCode[ FD_CONNECT_BIT ]; + ok ( err == 0, "event_client (%x): connect error: %d\n", id, err ); + if ( err ) goto out; + } trace ( "event_client (%x) connected\n", id );