apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: apr/include apr_errno.h
Date Tue, 16 Mar 2004 02:41:04 GMT
bnicholes    2004/03/15 18:41:04

  Modified:    include  Tag: APR_0_9_BRANCH apr_errno.h
  Log:
  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
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.112.2.2 +5 -4      apr/include/apr_errno.h
  
  Index: apr_errno.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_errno.h,v
  retrieving revision 1.112.2.1
  retrieving revision 1.112.2.2
  diff -u -r1.112.2.1 -r1.112.2.2
  --- apr_errno.h	13 Feb 2004 09:33:44 -0000	1.112.2.1
  +++ apr_errno.h	16 Mar 2004 02:41:04 -0000	1.112.2.2
  @@ -1038,14 +1038,15 @@
   
   #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)
   
  
  
  

Mime
View raw message