diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2002-02-26 02:49:49 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2002-02-26 02:49:49 (GMT) |
commit | 7154ce21a4b46a92c79c288621d6856eaacabee4 (patch) | |
tree | 7ad1808b6946ad108c891f33adb77499c922d96d | |
parent | e77d44200d7bdbaff49d22e5373c3aacafd041b0 (diff) | |
download | tcl-7154ce21a4b46a92c79c288621d6856eaacabee4.zip tcl-7154ce21a4b46a92c79c288621d6856eaacabee4.tar.gz tcl-7154ce21a4b46a92c79c288621d6856eaacabee4.tar.bz2 |
* mac/tclMacSock.c (TcpGetOptionProc): Changed to recognize the
option "-error". Essentially ignores the option, always
returning an empty string.
FossilOrigin-Name: aa1de44a3e0a0a56a31db01e1d1e3def222359a6
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | mac/tclMacSock.c | 30 |
2 files changed, 33 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2002-02-25 Andreas Kupries <andreas_kupries@users.sourceforge.net> + + * mac/tclMacSock.c (TcpGetOptionProc): Changed to recognize the + option "-error". Essentially ignores the option, always + returning an empty string. + 2002-02-25 Miguel Sofer <msofer@users.sourceforge.net> * generic/tclBasic.c (Tcl_EvalEx): avoiding a buffer overrun 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; } } |