summaryrefslogtreecommitdiffstats
path: root/win/tclWinChan.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-31 14:58:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-01-31 14:58:07 (GMT)
commitbfad7e731e065f729b1b29430eadc5599fed2221 (patch)
treee70de8a0b599ae989b87e4991c3da262f6ea1d33 /win/tclWinChan.c
parentff4989d1928248d02e222c2590088c0a5dbb6f46 (diff)
downloadtcl-bfad7e731e065f729b1b29430eadc5599fed2221.zip
tcl-bfad7e731e065f729b1b29430eadc5599fed2221.tar.gz
tcl-bfad7e731e065f729b1b29430eadc5599fed2221.tar.bz2
Make Tcl_ChannelCloseProc() deprecated too. Implement close2Proc and wideSeekProc for all internal channel types.
Diffstat (limited to 'win/tclWinChan.c')
-rw-r--r--win/tclWinChan.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 829cc74..b7f5c04 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -76,7 +76,7 @@ static int FileBlockProc(ClientData instanceData, int mode);
static void FileChannelExitHandler(ClientData clientData);
static void FileCheckProc(ClientData clientData, int flags);
static int FileCloseProc(ClientData instanceData,
- Tcl_Interp *interp);
+ Tcl_Interp *interp, int flags);
static int FileEventProc(Tcl_Event *evPtr, int flags);
static int FileGetHandleProc(ClientData instanceData,
int direction, ClientData *handlePtr);
@@ -107,7 +107,7 @@ static int NativeIsComPort(const WCHAR *nativeName);
static const Tcl_ChannelType fileChannelType = {
"file", /* Type name. */
TCL_CHANNEL_VERSION_5, /* v5 channel */
- FileCloseProc, /* Close proc. */
+ TCL_CLOSE2PROC, /* Close proc. */
FileInputProc, /* Input proc. */
FileOutputProc, /* Output proc. */
#ifndef TCL_NO_DEPRECATED
@@ -119,7 +119,7 @@ static const Tcl_ChannelType fileChannelType = {
NULL, /* Get option proc. */
FileWatchProc, /* Set up the notifier to watch the channel. */
FileGetHandleProc, /* Get an OS handle from channel. */
- NULL, /* close2proc. */
+ FileCloseProc, /* close2proc. */
FileBlockProc, /* Set blocking or non-blocking mode.*/
NULL, /* flush proc. */
NULL, /* handler proc. */
@@ -392,12 +392,18 @@ FileBlockProc(
static int
FileCloseProc(
ClientData instanceData, /* Pointer to FileInfo structure. */
- Tcl_Interp *interp) /* Not used. */
+ Tcl_Interp *dummy, /* Not used. */
+ int flags)
{
FileInfo *fileInfoPtr = instanceData;
FileInfo *infoPtr;
ThreadSpecificData *tsdPtr;
int errorCode = 0;
+ (void)dummy;
+
+ if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) {
+ return EINVAL;
+ }
/*
* Remove the file from the watch list.