diff options
Diffstat (limited to 'mac/tclMacSock.c')
-rw-r--r-- | mac/tclMacSock.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/mac/tclMacSock.c b/mac/tclMacSock.c index 70380b1..f3cdaf4 100644 --- a/mac/tclMacSock.c +++ b/mac/tclMacSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacSock.c,v 1.12 2002/01/27 11:10:07 das Exp $ + * RCS: @(#) $Id: tclMacSock.c,v 1.13 2002/02/26 02:49:50 andreas_kupries Exp $ */ #include "tclInt.h" @@ -1354,7 +1354,7 @@ TcpGetOptionProc( * value; initialized by caller. */ { TcpState *statePtr = (TcpState *) instanceData; - int doPeerName = false, doSockName = false, doAll = false; + int doPeerName = false, doSockName = false, doError = false, doAll = false; ip_addr tcpAddress; char buffer[128]; OSErr err; @@ -1392,9 +1392,33 @@ TcpGetOptionProc( doPeerName = true; } else if (!strcmp(optionName, "-sockname")) { doSockName = true; + } else if (!strcmp(optionName, "-error")) { + /* SF Bug #483575 */ + doError = true; } else { return Tcl_BadChannelOption(interp, optionName, - "peername sockname"); + "error peername sockname"); + } + } + + /* + * SF Bug #483575 + * + * Return error information. Currently we ignore + * this option. IOW, we always return the empty + * string, signaling 'no error'. + * + * FIXME: Get a mac/socket expert to write a correct + * FIXME: implementation. + */ + + if (doAll || doError) { + if (doAll) { + Tcl_DStringAppendElement(dsPtr, "-error"); + Tcl_DStringAppendElement(dsPtr, ""); + } else { + Tcl_DStringAppend (dsPtr, ""); + return TCL_OK; } } |