Define EWOULDBLOCK to the same value as EAGAIN.
authorPaolo Bonzini <bonzini@gnu.org>
Fri, 3 Oct 2008 16:23:59 +0000 (18:23 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 3 Oct 2008 16:23:59 +0000 (18:23 +0200)
ChangeLog
lib/errno.in.h
lib/strerror.c
lib/winsock.c

index ec136e242f9bdaf6518457f4b1c6a2e4edb1da9e..99db385d82665305f2f44e0d5cd7ac5ce9942663 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 7ffa203f8adbcfa9210edd0fd61bdbf1741fb223..df2dab099a39c071614a9fb583cb97d7df7633a5 100644 (file)
 /* 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
index 2393c67d3a1973b634f449656f1b1db775cf652c..787575fda58fd380fa70d28b0e6a941dc151f013 100644 (file)
@@ -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 */
index 535145a813aac869044cba26876e33a4c5ecb796..23621d1b449820d069fe537daf6969f69410f05d 100644 (file)
@@ -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;