Skip Menu |
 

From: hartmans@mit.edu
Subject: SVN Commit
Download (untitled) / with headers
text/plain 1.2KiB

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>

https://github.com/krb5/krb5/commit/fc08c21ab33fcc0c8851a2a0fb0e55721ff975ea
Author: Kevin Wasserman <kevin.wasserman@painless-security.com>
Committer: Sam Hartman <hartmans@mit.edu>
Commit: fc08c21ab33fcc0c8851a2a0fb0e55721ff975ea
Branch: master
src/include/port-sockets.h | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)
From: tlyu@mit.edu
Subject: SVN Commit
Download (untitled) / with headers
text/plain 1.2KiB

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)

https://github.com/krb5/krb5/commit/87a863eb65796196dbe09de8da0de634ce6d8817
Author: Kevin Wasserman <kevin.wasserman@painless-security.com>
Committer: Tom Yu <tlyu@mit.edu>
Commit: 87a863eb65796196dbe09de8da0de634ce6d8817
Branch: krb5-1.10
src/include/port-sockets.h | 36 +++++++++++++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 1 deletions(-)