diff options
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 7814e32..4f676e6 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.159 2009/02/10 22:49:45 nijtmans Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.160 2009/07/23 22:49:15 andreas_kupries Exp $ */ #include "tclInt.h" @@ -2085,6 +2085,14 @@ Tcl_GetChannelHandle( int result; chanPtr = ((Channel *) chan)->state->bottomChanPtr; + if (!chanPtr->typePtr->getHandleProc) { + Tcl_Obj* err; + TclNewLiteralStringObj(err, "channel \""); + Tcl_AppendToObj(err, Tcl_GetChannelName(chan), -1); + Tcl_AppendToObj(err, "\" does not support OS handles", -1); + Tcl_SetChannelError (chan,err); + return TCL_ERROR; + } result = chanPtr->typePtr->getHandleProc(chanPtr->instanceData, direction, &handle); if (handlePtr) { |