Attachment "483575.diff" to
ticket [483575ffff]
added by
andreas_kupries
2002-02-26 09:46:53.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.226.2.116
diff -u -r1.226.2.116 ChangeLog
--- ChangeLog 25 Feb 2002 23:36:48 -0000 1.226.2.116
+++ ChangeLog 26 Feb 2002 02:46:12 -0000
@@ -1,3 +1,9 @@
+2002-02-25 Tcl Project <[email protected]>
+
+ * mac/tclMacSock.c (TcpGetOptionProc): Changed to recognize the
+ option "-error". Essentially ignores the option, always
+ returning an empty string.
+
2002-02-25 Jeff Hobbs <[email protected]>
* win/tclWinNotify.c (Tcl_FinalizeNotifier): backported fix for
Index: mac/tclMacSock.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacSock.c,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 tclMacSock.c
--- mac/tclMacSock.c 4 Apr 2001 21:22:19 -0000 1.7.2.2
+++ mac/tclMacSock.c 26 Feb 2002 02:46:12 -0000
@@ -1354,7 +1354,7 @@
* 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 @@
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;
}
}