diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2014-04-07 12:34:18 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2014-04-07 12:34:18 (GMT) |
commit | 77113c6828286012fe17288e3132811cb24f6fe3 (patch) | |
tree | f057b2bc31f65ce64501ee5564f4b0b86a77932d /win | |
parent | 4b6ab47efdc71922068677ef074031e180f359d9 (diff) | |
download | tcl-77113c6828286012fe17288e3132811cb24f6fe3.zip tcl-77113c6828286012fe17288e3132811cb24f6fe3.tar.gz tcl-77113c6828286012fe17288e3132811cb24f6fe3.tar.bz2 |
Return async connect error by first following read or write operation.
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinSock.c | 13 |
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. */ |