summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixChan.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-04-19 08:32:42 (GMT)
committerhobbs <hobbs@noemail.net>2000-04-19 08:32:42 (GMT)
commit5a0c2f1ed19f204e0910cc20544bbbd7b99d71f1 (patch)
treed0760a65b11e677dd7757cb4a48fb036769992db /unix/tclUnixChan.c
parent064a5ec74ce54f1d6d7481bbafa78e182aeed53d (diff)
downloadtcl-5a0c2f1ed19f204e0910cc20544bbbd7b99d71f1.zip
tcl-5a0c2f1ed19f204e0910cc20544bbbd7b99d71f1.tar.gz
tcl-5a0c2f1ed19f204e0910cc20544bbbd7b99d71f1.tar.bz2
* README:
* generic/tcl.h: * tools/tcl.wse.in: * unix/configure.in: * unix/tcl.spec: * win/configure.in: * win/README.binary: bumped version to 8.3.1 * win/tcl.hpj.in: updated copyright date * generic/tclEnv.c: environment support for Mac OS/X * unix/tclUnixPort.h: environment support for Mac OS/X * unix/tclLoadDyld.c: new file for Mac OS/X dl functions * unix/Makefile.in: added install-strip target; bindir, libdir, mandir, includedir vars; tclLoadDyld.c target [Bug: 2527] * unix/tclUnixChan.c (CreateSocket): force a socket back into blocking mode (default state) after a -async connect succeeds. [Bug: 4388] * generic/tclEvent.c (TclInitSubsystems): Moved tclLibraryPath to thread-local storage to prevent thread-related race condition. [Bug: 5033] * unix/tclAppInit.c (main): removed #ifdef TCL_TEST that sets the library path as it was unnecessary and conflicts with move of tclLibraryPath to thread-local storage. FossilOrigin-Name: 2bb0593bdff552c313069e7eaf4fc17d4e269b63
Diffstat (limited to 'unix/tclUnixChan.c')
-rw-r--r--unix/tclUnixChan.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index b0a57f5..3420fd4 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixChan.c,v 1.15 2000/04/15 17:34:23 hobbs Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.16 2000/04/19 08:32:46 hobbs Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -2056,7 +2056,27 @@ CreateSocket(interp, port, host, server, myaddr, myport, async)
asyncConnect = 1;
status = 0;
}
- }
+ } else {
+ /*
+ * Here we are if the connect succeeds. In case of an
+ * asynchronous connect we have to reset the channel to
+ * blocking mode. This appears to happen not very often,
+ * but e.g. on a HP 9000/800 under HP-UX B.11.00 we enter
+ * this stage. [Bug: 4388]
+ */
+ if (async) {
+#ifndef USE_FIONBIO
+ origState = fcntl(sock, F_GETFL);
+ curState = origState & ~(O_NONBLOCK);
+ status = fcntl(sock, F_SETFL, curState);
+#endif
+
+#ifdef USE_FIONBIO
+ curState = 0;
+ status = ioctl(sock, FIONBIO, &curState);
+#endif
+ }
+ }
}
}