summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredman <redman>1999-05-18 17:38:29 (GMT)
committerredman <redman>1999-05-18 17:38:29 (GMT)
commit48fa4cd8aa0c3ab10b51c6b4553a67b3ded15434 (patch)
tree89feadb18e73740bcff9b16a499f9ca91f2ffe79
parent066b2c80e6380b10ea526000113ea80d5945d62e (diff)
downloadtcl-48fa4cd8aa0c3ab10b51c6b4553a67b3ded15434.zip
tcl-48fa4cd8aa0c3ab10b51c6b4553a67b3ded15434.tar.gz
tcl-48fa4cd8aa0c3ab10b51c6b4553a67b3ded15434.tar.bz2
Don't connect to FILE_TYPE_CHAR devices unless they are a
FILE_TYPE_SERIAL or FILE_TYPE_CONSOLE type. Don't connect to FILE_TYPE_UNKNOWN either. Do connect (and add case) for FILE_TYPE_DISK.
-rw-r--r--win/tclWinChan.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index e2126fb..254a24c 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.6 1999/04/16 00:48:07 stanton Exp $
+ * RCS: @(#) $Id: tclWinChan.c,v 1.6.2.1 1999/05/18 17:38:29 redman Exp $
*/
#include "tclWinInt.h"
@@ -811,13 +811,22 @@ TclpOpenFileChannel(interp, fileName, modeString, permissions)
}
channel = TclpCreateCommandChannel(readFile, writeFile, NULL, 0, NULL);
break;
- case FILE_TYPE_CHAR:
- default:
+ case FILE_TYPE_DISK:
channel = TclWinOpenFileChannel(handle, channelName,
channelPermissions,
(mode & O_APPEND) ? FILE_APPEND : 0);
break;
+ case FILE_TYPE_CHAR:
+ default:
+ /*
+ * The handle is of an unknown type, probably /dev/nul equivalent
+ * or possibly a closed handle. Don't use it, otherwise Tk runs into
+ * trouble with the MS DevStudio debugger.
+ */
+
+ channel = NULL;
+ break;
}
Tcl_DStringFree(&buffer);