diff options
author | hobbs <hobbs> | 2001-10-15 17:34:53 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-10-15 17:34:53 (GMT) |
commit | 9ce08ed0d03dd45d4d8fd3968add14909bc7b982 (patch) | |
tree | aa2c5fe10b7ae3389a7ad43dc74cc4941aad43d3 /win/tclWinChan.c | |
parent | cea1e11d92ee9e3efc79d5a9c26d7a516907eddc (diff) | |
download | tcl-9ce08ed0d03dd45d4d8fd3968add14909bc7b982.zip tcl-9ce08ed0d03dd45d4d8fd3968add14909bc7b982.tar.gz tcl-9ce08ed0d03dd45d4d8fd3968add14909bc7b982.tar.bz2 |
* win/tclWinChan.c:
* win/tclWinPort.h:
* win/tclWinSerial.c: added TIP #35 Windows enhancements for
serial configuration. [Patch #438509] (schroedter)
Diffstat (limited to 'win/tclWinChan.c')
-rw-r--r-- | win/tclWinChan.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 78b7daf..e1672c7 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinChan.c,v 1.15 2001/09/07 17:08:50 andreas_kupries Exp $ + * RCS: @(#) $Id: tclWinChan.c,v 1.16 2001/10/15 17:34:53 hobbs Exp $ */ #include "tclWinInt.h" @@ -797,6 +797,20 @@ TclpOpenFileChannel(interp, pathPtr, modeString, permissions) switch (type) { case FILE_TYPE_SERIAL: + /* + * Reopen channel for OVERLAPPED operation + * Normally this shouldn't fail, because the channel exists + */ + handle = TclWinSerialReopen(handle, nativeName, accessMode); + if (handle == INVALID_HANDLE_VALUE) { + TclWinConvertError(GetLastError()); + if (interp != (Tcl_Interp *) NULL) { + Tcl_AppendResult(interp, "couldn't reopen serial \"", + Tcl_GetString(pathPtr), "\": ", + Tcl_PosixError(interp), (char *) NULL); + } + return NULL; + } channel = TclWinOpenSerialChannel(handle, channelName, channelPermissions); break; |