summaryrefslogtreecommitdiff
path: root/include/apr_errno.h
diff options
context:
space:
mode:
authorbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2004-03-16 02:09:38 +0000
committerbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2004-03-16 02:09:38 +0000
commit58715b67e1f9ecf8d23ab44f949aa4912be308c2 (patch)
tree8a0f4cbb4144660ba24c52fff1c97d1cb784eb32 /include/apr_errno.h
parent642f7957f63dc8476729075c799a8252349a1285 (diff)
downloadlibapr-58715b67e1f9ecf8d23ab44f949aa4912be308c2.tar.gz
Use the correct macros for converting between winsock net errors and apr on NetWare
submitted by: Jean-Jacques Clar<JJCLAR@novell.com> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65002 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_errno.h')
-rw-r--r--include/apr_errno.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/apr_errno.h b/include/apr_errno.h
index 6bc8c219f..094d1fbe0 100644
--- a/include/apr_errno.h
+++ b/include/apr_errno.h
@@ -1043,14 +1043,15 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
#elif defined(NETWARE) && !defined(DOXYGEN) /* !defined(OS2) && !defined(WIN32) */
-#define APR_FROM_OS_ERROR(e) (e)
-#define APR_TO_OS_ERROR(e) (e)
+#define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
+#define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
#define apr_get_os_error() (errno)
#define apr_set_os_error(e) (errno = (e))
-#define apr_get_netos_error() (WSAGetLastError()+APR_OS_START_SYSERR)
-#define apr_set_netos_error(e) (WSASetLastError((e)-APR_OS_START_SYSERR))
+/* A special case, only socket calls require this: */
+#define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError()))
+#define apr_set_netos_error(e) (WSASetLastError(APR_TO_OS_ERROR(e)))
#define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS)