summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2008-12-10 02:20:25 (GMT)
committerdavygrvy <davygrvy@pobox.com>2008-12-10 02:20:25 (GMT)
commit1124fc8a23b84c0835c4e963438ec7d8c87c2e3e (patch)
tree2537dcb028814930523d37194f8d1903f87937fb
parent8817f6b6137d1d30d4745d71573f962f19562eb8 (diff)
downloadtcl-1124fc8a23b84c0835c4e963438ec7d8c87c2e3e.zip
tcl-1124fc8a23b84c0835c4e963438ec7d8c87c2e3e.tar.gz
tcl-1124fc8a23b84c0835c4e963438ec7d8c87c2e3e.tar.bz2
some wsae errors were skipped over
-rw-r--r--win/tclWinError.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/win/tclWinError.c b/win/tclWinError.c
index 821686c..274c672 100644
--- a/win/tclWinError.c
+++ b/win/tclWinError.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinError.c,v 1.7.12.1 2008/12/07 01:23:34 davygrvy Exp $
+ * RCS: @(#) $Id: tclWinError.c,v 1.7.12.2 2008/12/10 02:20:25 davygrvy Exp $
*/
#include "tclInt.h"
@@ -297,6 +297,16 @@ static const unsigned int tableLen = sizeof(errorTable);
*/
static int wsaErrorTable1[] = {
+ EINVAL, /* WSAEINTR */
+ EINVAL, /* WSAEBADF */
+ EINVAL, /* WSAEACCES */
+ EINVAL, /* WSAEFAULT */
+ EINVAL, /* WSAEINVAL */
+ EINVAL, /* WSAEMFILE */
+};
+
+
+static int wsaErrorTable2[] = {
EWOULDBLOCK, /* WSAEWOULDBLOCK */
EINPROGRESS, /* WSAEINPROGRESS */
EALREADY, /* WSAEALREADY */
@@ -343,7 +353,7 @@ static int wsaErrorTable1[] = {
* TODO: Fixme!
*/
-static int wsaErrorTable2[] = {
+static int wsaErrorTable3[] = {
EINVAL, /* WSASYSNOTREADY WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable. */
EINVAL, /* WSAVERNOTSUPPORTED The Windows Sockets version requested is not supported. */
EINVAL, /* WSANOTINITIALISED Either the application has not called WSAStartup, or WSAStartup failed. */
@@ -375,7 +385,7 @@ static int wsaErrorTable2[] = {
* TODO: Fixme!
*/
-static int wsaErrorTable3[] = {
+static int wsaErrorTable4[] = {
EINVAL, /* WSAHOST_NOT_FOUND, Authoritative Answer: Host not found */
EINVAL, /* WSATRY_AGAIN, Non-Authoritative: Host not found, or SERVERFAIL */
EINVAL, /* WSANO_RECOVERY, Non-recoverable errors, FORMERR, REFUSED, NOTIMP */
@@ -457,12 +467,14 @@ void
TclWinConvertWSAError(
DWORD errCode) /* Win32 error code. */
{
- if ((errCode >= WSAEWOULDBLOCK) && (errCode <= WSAEREMOTE)) {
- Tcl_SetErrno(wsaErrorTable1[errCode - WSAEWOULDBLOCK]);
+ if ((errCode >= WSAEINTR) && (errCode <= WSAEMFILE)) {
+ Tcl_SetErrno(wsaErrorTable1[errCode - WSAEINTR]);
+ } else if ((errCode >= WSAEWOULDBLOCK) && (errCode <= WSAEREMOTE)) {
+ Tcl_SetErrno(wsaErrorTable2[errCode - WSAEWOULDBLOCK]);
} else if ((errCode >= WSASYSNOTREADY) && (errCode <= WSAEREFUSED)) {
- Tcl_SetErrno(wsaErrorTable2[errCode - WSASYSNOTREADY]);
+ Tcl_SetErrno(wsaErrorTable3[errCode - WSASYSNOTREADY]);
} else if ((errCode >= WSAHOST_NOT_FOUND) && (errCode <= WSA_QOS_RESERVED_PETYPE)) {
- Tcl_SetErrno(wsaErrorTable3[errCode - WSAHOST_NOT_FOUND]);
+ Tcl_SetErrno(wsaErrorTable4[errCode - WSAHOST_NOT_FOUND]);
} else {
Tcl_SetErrno(EINVAL);
}