summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/tclWinSock.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index ed9fa32..b05dc32 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -585,11 +585,22 @@ WaitForConnect(
ThreadSpecificData *tsdPtr;
/*
+ * Check if an async connect error is not jet reported.
+ * If yes, report it now.
+ */
+
+ if ( errorCodePtr != NULL && statePtr->error != 0 ) {
+ *errorCodePtr = statePtr->error;
+ statePtr->error = 0;
+ return -1;
+ }
+
+ /*
* Check if an async connect is running. If not return ok
*/
if ( !(statePtr->flags & TCP_ASYNC_CONNECT_REENTER_PENDING) )
return 0;
-
+
/*
* Be sure to disable event servicing so we are truly modal.
*/