summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2004-03-16 02:41:04 +0000
committerbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2004-03-16 02:41:04 +0000
commit5f01db9ed0906525615a289e6bd669cdacee0f17 (patch)
tree379e918b0a0e09bac4215e2dac6f53a6132f5275
parent38aa72aa94a8f7c5936d364ef083b3779683e27b (diff)
downloadlibapr-5f01db9ed0906525615a289e6bd669cdacee0f17.tar.gz
Use the correct macros for converting between winsock net errors and apr on NetWare
submitted by: Jean-Jacques Clar<JJCLAR@novell.com> reviewed by: Brad Nicholes git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@65004 13f79535-47bb-0310-9956-ffa450edef68
-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 b79034b49..236ec467c 100644
--- a/include/apr_errno.h
+++ b/include/apr_errno.h
@@ -1038,14 +1038,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)