diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-04 13:42:42 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-03-04 13:42:42 (GMT) |
| commit | 8defb7d10b69cdbe3219de6ae2dc169dc8df8bb9 (patch) | |
| tree | d2f706832df81f622d3246731bef82f25668218a /win/tclWinConsole.c | |
| parent | a4154b246b048a378dd83998031d103263856c8f (diff) | |
| download | tcl-8defb7d10b69cdbe3219de6ae2dc169dc8df8bb9.zip tcl-8defb7d10b69cdbe3219de6ae2dc169dc8df8bb9.tar.gz tcl-8defb7d10b69cdbe3219de6ae2dc169dc8df8bb9.tar.bz2 | |
Implement WideSeekProc() for all channels which have a SeekProc(). Implement Close2Proc() for all channels, as minimal wrapper around CloseProc().
Backported (with comments) and adapted from core-8-branch.
Diffstat (limited to 'win/tclWinConsole.c')
| -rw-r--r-- | win/tclWinConsole.c | 18 |
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; +} /* *---------------------------------------------------------------------- |
