changeset 30265:ac46e8160cc9

Define EWOULDBLOCK to the same value as EAGAIN.
author Paolo Bonzini <bonzini@gnu.org>
date Fri, 03 Oct 2008 18:23:59 +0200
parents a1abe7f158c1
children 34f144388312
files ChangeLog lib/errno.in.h lib/strerror.c lib/winsock.c
diffstat 4 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Oct 03 10:31:28 2008 +0200
+++ b/ChangeLog	Fri Oct 03 18:23:59 2008 +0200
@@ -1,3 +1,10 @@
+2008-10-03  Paolo Bonzini  <bonzini@gnu.org>
+            Bruno Haible  <bruno@clisp.org>
+
+	* 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  <kdudka@redhat.com>
 
 	filevercmp: new module
--- a/lib/errno.in.h	Fri Oct 03 10:31:28 2008 +0200
+++ b/lib/errno.in.h	Fri Oct 03 18:23:59 2008 +0200
@@ -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 <winsock2.h>.  */
-#  define EWOULDBLOCK     10035
 #  define EINPROGRESS     10036
 #  define EALREADY        10037
 #  define ENOTSOCK        10038
--- a/lib/strerror.c	Fri Oct 03 10:31:28 2008 +0200
+++ b/lib/strerror.c	Fri Oct 03 18:23:59 2008 +0200
@@ -49,8 +49,7 @@
 # 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 @@
     /* 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 */
--- a/lib/winsock.c	Fri Oct 03 10:31:28 2008 +0200
+++ b/lib/winsock.c	Fri Oct 03 18:23:59 2008 +0200
@@ -91,6 +91,9 @@
     case WSA_INVALID_PARAMETER:
       errno = EINVAL;
       break;
+    case WSAEWOULDBLOCK:
+      errno = EWOULDBLOCK;
+      break;
     case WSAENAMETOOLONG:
       errno = ENAMETOOLONG;
       break;