summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclIOSock.c7
-rw-r--r--unix/tclUnixSock.c7
3 files changed, 11 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index f44a0b5..7da1cd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-26 Reinhard Max <max@suse.de>
+
+ * generic/tclIOSock.c: Use EAI_SYSTEM only if it exists.
+ * unix/tclUnixSock.c:
+
2012-06-25 Don Porter <dgp@users.sourceforge.net>
* generic/tclFileSystem.h: [Bug 3024359] Make sure that the
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index 6a7be7e..ff23d5d 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -206,9 +206,12 @@ TclCreateSocketAddress(
}
if (result != 0) {
- if (result != EAI_SYSTEM) {
+#ifdef EAI_SYSTEM /* Doesn't exist on Windows */
+ if (result == EAI_SYSTEM)
+ *errorMsgPtr = Tcl_PosixError(interp);
+ else
+#endif
*errorMsgPtr = gai_strerror(result);
- }
return 0;
}
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index f6abfd5..1e9d4eb 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -1117,12 +1117,7 @@ Tcl_OpenTcpClient(
freeaddrinfo(addrlist);
}
if (interp != NULL) {
- Tcl_AppendResult(interp, "couldn't open socket: ", NULL);
- if (errorMsg == NULL) {
- Tcl_AppendResult(interp, Tcl_PosixError(interp), NULL);
- } else {
- Tcl_AppendResult(interp, errorMsg, NULL);
- }
+ Tcl_AppendResult(interp, "couldn't open socket: ", errorMsg, NULL);
}
return NULL;
}