From 125ad539a275db5ab8f4647828b80a16d02eabd2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 21 Apr 2016 16:58:47 -0400 Subject: Improve TranslateSocketError() to handle more Windows error codes. The coverage was rather lean for cases that bind() or listen() might return. Add entries for everything that there's a direct equivalent for in the set of Unix errnos that elog.c has heard of. --- src/include/port/win32.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/port/win32.h b/src/include/port/win32.h index c9390d1124..bd2ad99c11 100644 --- a/src/include/port/win32.h +++ b/src/include/port/win32.h @@ -285,20 +285,32 @@ typedef int pid_t; #define EAFNOSUPPORT WSAEAFNOSUPPORT #undef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK +#undef ECONNABORTED +#define ECONNABORTED WSAECONNABORTED #undef ECONNRESET #define ECONNRESET WSAECONNRESET #undef EINPROGRESS #define EINPROGRESS WSAEINPROGRESS +#undef EISCONN +#define EISCONN WSAEISCONN #undef ENOBUFS #define ENOBUFS WSAENOBUFS #undef EPROTONOSUPPORT #define EPROTONOSUPPORT WSAEPROTONOSUPPORT #undef ECONNREFUSED #define ECONNREFUSED WSAECONNREFUSED -#undef EBADFD -#define EBADFD WSAENOTSOCK +#undef ENOTSOCK +#define ENOTSOCK WSAENOTSOCK #undef EOPNOTSUPP #define EOPNOTSUPP WSAEOPNOTSUPP +#undef EADDRINUSE +#define EADDRINUSE WSAEADDRINUSE +#undef EADDRNOTAVAIL +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#undef EHOSTUNREACH +#define EHOSTUNREACH WSAEHOSTUNREACH +#undef ENOTCONN +#define ENOTCONN WSAENOTCONN /* * Extended locale functions with gratuitous underscore prefixes. -- cgit v1.2.3