]> git.ipfire.org Git - thirdparty/krb5.git/commit
Translate WinSock errors to Posix counterparts
authorKevin Wasserman <kevin.wasserman@painless-security.com>
Fri, 20 Apr 2012 15:36:13 +0000 (11:36 -0400)
committerTom Yu <tlyu@mit.edu>
Mon, 23 Jul 2012 18:19:38 +0000 (14:19 -0400)
commit87a863eb65796196dbe09de8da0de634ce6d8817
treefb4e41e7efd853dea8c9a3dffd0273e51625865e
parent983b3e9d13e05e21dac4acdb7552e8d9079bb0d5
Translate WinSock errors to Posix counterparts

MSVC 2010 defines both Posix and WinSock error values so we can no longer
simply #define the Posix error values to be their WinSock counterpart.
This patch explicitly #includes <errno.h> in port-sockets.h and still
conditionally defines the Posix error values for compatibility with older
MSVC but also translates WinSock errors to Posix for MSVC 2010
compatibility.

The downside to this approach is that there are some Posix errors we
do not currently detect (e.g. EADDRINUSE) that are neither #defined nor
translated.  If we use one of those in the future but fail to update
TranslateWSAGetLastError() we'll once again be in the situation that the
windows build will compile but fail to work, possibly only when some rare
error condition occurs.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
(cherry picked from commit fc08c21ab33fcc0c8851a2a0fb0e55721ff975ea)

ticket: 7197
version_fixed: 1.10.3
status: resolved
src/include/port-sockets.h