summaryrefslogtreecommitdiffstats
path: root/generic/tclIORTrans.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 /generic/tclIORTrans.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 'generic/tclIORTrans.c')
-rw-r--r--generic/tclIORTrans.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index 70dd640..316378f 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -32,7 +32,7 @@
*/
static int ReflectClose(ClientData clientData,
- Tcl_Interp *interp);
+ Tcl_Interp *interp, int flags);
static int ReflectInput(ClientData clientData, char *buf,
int toRead, int *errorCodePtr);
static int ReflectOutput(ClientData clientData, const char *buf,
@@ -62,7 +62,7 @@ static int ReflectNotify(ClientData clientData, int mask);
static const Tcl_ChannelType tclRTransformType = {
"tclrtransform", /* Type name. */
TCL_CHANNEL_VERSION_5, /* v5 channel. */
- ReflectClose, /* Close channel, clean instance data. */
+ TCL_CLOSE2PROC, /* Close channel, clean instance data. */
ReflectInput, /* Handle read request. */
ReflectOutput, /* Handle write request. */
#ifndef TCL_NO_DEPRECATED
@@ -74,7 +74,7 @@ static const Tcl_ChannelType tclRTransformType = {
ReflectGetOption, /* Get options. */
ReflectWatch, /* Initialize notifier. */
ReflectHandle, /* Get OS handle from the channel. */
- NULL, /* No close2 support. NULL'able. */
+ ReflectClose, /* No close2 support. NULL'able. */
ReflectBlock, /* Set blocking/nonblocking. */
NULL, /* Flush channel. Not used by core.
* NULL'able. */
@@ -885,7 +885,8 @@ UnmarshallErrorResult(
static int
ReflectClose(
ClientData clientData,
- Tcl_Interp *interp)
+ Tcl_Interp *interp,
+ int flags)
{
ReflectedTransform *rtPtr = clientData;
int errorCode, errorCodeSet = 0;
@@ -896,6 +897,10 @@ ReflectClose(
* in this interp. */
Tcl_HashEntry *hPtr; /* Entry in the above map */
+ if ((flags & (TCL_CLOSE_READ | TCL_CLOSE_WRITE)) != 0) {
+ return EINVAL;
+ }
+
if (TclInThreadExit()) {
/*
* This call comes from TclFinalizeIOSystem. There are no