apr_errno: add APR_EALREADY, eventually mapped from system's [WSA]EALREADY.


git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1883874 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/include/apr_errno.h b/include/apr_errno.h
index d2abfb1..3a00457 100644
--- a/include/apr_errno.h
+++ b/include/apr_errno.h
@@ -853,6 +853,13 @@
 #define APR_ERANGE          (APR_OS_START_CANONERR + 29)
 #endif
 
+/** @see APR_STATUS_IS_EALREADY */
+#ifdef EALREADY
+#define APR_EALREADY EALREADY
+#else
+#define APR_EALREADY      (APR_OS_START_CANONERR + 30)
+#endif
+
 /** @} */
 
 #if defined(OS2) && !defined(DOXYGEN)
@@ -996,13 +1003,14 @@
 #define APR_STATUS_IS_EOPNOTSUPP(s)     ((s) == APR_EOPNOTSUPP \
                 || (s) == APR_OS_START_SYSERR + SOCEOPNOTSUPP)
 #define APR_STATUS_IS_ERANGE(s)         ((s) == APR_ERANGE)
+#define APR_STATUS_IS_EALREADY(s)       ((s) == APR_EALREADY \
+                || (s) == APR_OS_START_SYSERR + SOCEALREADY)
 
 /*
     Sorry, too tired to wrap this up for OS2... feel free to
     fit the following into their best matches.
 
     { ERROR_NO_SIGNAL_SENT,     ESRCH           },
-    { SOCEALREADY,              EALREADY        },
     { SOCEDESTADDRREQ,          EDESTADDRREQ    },
     { SOCEMSGSIZE,              EMSGSIZE        },
     { SOCEPROTOTYPE,            EPROTOTYPE      },
@@ -1143,6 +1151,8 @@
 #define APR_STATUS_IS_EOPNOTSUPP(s)     ((s) == APR_EOPNOTSUPP \
                 || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP)
 #define APR_STATUS_IS_ERANGE(s)         ((s) == APR_ERANGE)
+#define APR_STATUS_IS_EALREADY(s)       ((s) == APR_EALREADY \
+                || (s) == APR_OS_START_SYSERR + WSAEALREADY)
 
 #elif defined(NETWARE) && defined(USE_WINSOCK) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */
 
@@ -1207,6 +1217,8 @@
 #define APR_STATUS_IS_EOPNOTSUPP(s)     ((s) == APR_EOPNOTSUPP \
                 || (s) == APR_OS_START_SYSERR + WSAEOPNOTSUPP)
 #define APR_STATUS_IS_ERANGE(s)         ((s) == APR_ERANGE)
+#define APR_STATUS_IS_EALREADY(s)       ((s) == APR_EALREADY \
+                || (s) == APR_OS_START_SYSERR + WSAEALREADY)
 
 #else /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
 
@@ -1331,6 +1343,9 @@
 
 /** Numeric value not representable */
 #define APR_STATUS_IS_ERANGE(s)         ((s) == APR_ERANGE)
+
+/** Operation already in progress */
+#define APR_STATUS_IS_EALREADY(s)       ((s) == APR_EALREADY)
 /** @} */
 
 #endif /* !defined(NETWARE) && !defined(OS2) && !defined(WIN32) */
diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
index a45d43f..f106cde 100644
--- a/misc/unix/errorcodes.c
+++ b/misc/unix/errorcodes.c
@@ -139,6 +139,8 @@
         return "The given lock was busy.";
     case APR_EPROC_UNKNOWN:
         return "The process is not recognized.";
+    case APR_EALREADY:
+        return "Operation already in progress";
     case APR_EGENERAL:
         return "Internal error (specific information not available)";