summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--mac/tclMacSock.c30
2 files changed, 33 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 09fe37d..5ebd04a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
}
}