From: Paolo Bonzini Date: Fri, 3 Oct 2008 16:23:59 +0000 (+0200) Subject: Define EWOULDBLOCK to the same value as EAGAIN. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b98e9dbb0e7fd2c0c6a6e1440ba3bb626c6ab7c3;p=pspp Define EWOULDBLOCK to the same value as EAGAIN. --- diff --git a/ChangeLog b/ChangeLog index ec136e242f..99db385d82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-10-03 Paolo Bonzini + Bruno Haible + + * lib/errno.in.h (EWOULDBLOCK) [win32]: Define to EAGAIN. + * lib/winsock.c (set_winsock_errno): Map WSAEWOULDBLOCK to EWOULDBLOCK. + * lib/strerror.c (rpl_strerror): Remove error string for EWOULDBLOCK. + 2008-10-03 Kamil Dudka filevercmp: new module diff --git a/lib/errno.in.h b/lib/errno.in.h index 7ffa203f8a..df2dab099a 100644 --- a/lib/errno.in.h +++ b/lib/errno.in.h @@ -30,13 +30,15 @@ /* On native Windows platforms, many macros are not defined. */ # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */ +# define EWOULDBLOCK EAGAIN + /* Values >= 100 seem safe to use. */ # define ETXTBSY 100 # define GNULIB_defined_ETXTBSY 1 /* These are intentionally the same values as the WSA* error numbers, defined in . */ -# define EWOULDBLOCK 10035 # define EINPROGRESS 10036 # define EALREADY 10037 # define ENOTSOCK 10038 diff --git a/lib/strerror.c b/lib/strerror.c index 2393c67d3a..787575fda5 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -49,8 +49,7 @@ rpl_strerror (int n) # endif # if GNULIB_defined_ESOCK /* native Windows platforms */ - case EWOULDBLOCK: - return "Operation would block"; + /* EWOULDBLOCK is the same as EAGAIN. */ case EINPROGRESS: return "Operation now in progress"; case EALREADY: @@ -134,8 +133,8 @@ rpl_strerror (int n) /* WSAEACCES maps to EACCES */ /* WSAEFAULT maps to EFAULT */ /* WSAEINVAL maps to EINVAL */ - /* WSAEMFILE maos to EMFILE */ - /* WSAEWOULDBLOCK is EWOULDBLOCK */ + /* WSAEMFILE maps to EMFILE */ + /* WSAEWOULDBLOCK maps to EWOULDBLOCK */ /* WSAEINPROGRESS is EINPROGRESS */ /* WSAEALREADY is EALREADY */ /* WSAENOTSOCK is ENOTSOCK */ diff --git a/lib/winsock.c b/lib/winsock.c index 535145a813..23621d1b44 100644 --- a/lib/winsock.c +++ b/lib/winsock.c @@ -91,6 +91,9 @@ set_winsock_errno (void) case WSA_INVALID_PARAMETER: errno = EINVAL; break; + case WSAEWOULDBLOCK: + errno = EWOULDBLOCK; + break; case WSAENAMETOOLONG: errno = ENAMETOOLONG; break;