summaryrefslogtreecommitdiffstats
path: root/win/tclWinConsole.c
diff options
context:
space:
mode:
Diffstat (limited to 'win/tclWinConsole.c')
-rw-r--r--win/tclWinConsole.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 173fe9e..1293ebe 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -140,6 +140,8 @@ static int ConsoleBlockModeProc(ClientData instanceData,
static void ConsoleCheckProc(ClientData clientData, int flags);
static int ConsoleCloseProc(ClientData instanceData,
Tcl_Interp *interp);
+static int ConsoleClose2Proc(ClientData instanceData,
+ Tcl_Interp *interp, int flags);
static int ConsoleEventProc(Tcl_Event *evPtr, int flags);
static void ConsoleExitHandler(ClientData clientData);
static int ConsoleGetHandleProc(ClientData instanceData,
@@ -179,7 +181,7 @@ static const Tcl_ChannelType consoleChannelType = {
NULL, /* Get option proc. */
ConsoleWatchProc, /* Set up notifier to watch the channel. */
ConsoleGetHandleProc, /* Get an OS handle from channel. */
- NULL, /* close2proc. */
+ ConsoleClose2Proc, /* close2proc. */
ConsoleBlockModeProc, /* Set blocking or non-blocking mode. */
NULL, /* Flush proc. */
NULL, /* Handler proc. */
@@ -506,7 +508,7 @@ ConsoleBlockModeProc(
/*
*----------------------------------------------------------------------
*
- * ConsoleCloseProc --
+ * ConsoleCloseProc/ConsoleClose2Proc --
*
* Closes a console based IO channel.
*
@@ -604,6 +606,18 @@ ConsoleCloseProc(
return errorCode;
}
+
+static int
+ConsoleClose2Proc(
+ ClientData instanceData, /* Pointer to ConsoleInfo structure. */
+ Tcl_Interp *interp, /* For error reporting. */
+ int flags)
+{
+ if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) == 0) {
+ return ConsoleCloseProc(instanceData, interp);
+ }
+ return EINVAL;
+}
/*
*----------------------------------------------------------------------