You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2002/09/10 20:13:29 UTC

Re: cvs commit: apr/network_io/unix sa_common.c

At 11:40 AM 9/10/2002, bnicholes@apache.org wrote:
>bnicholes    2002/09/10 09:40:13
>
>   Modified:    network_io/unix sa_common.c
>   Log:
>   Can not set h_errno on NetWare
>
>   +#ifndef NETWARE
>    #ifdef HAVE_SET_H_ERRNO
>    #define SET_H_ERRNO(newval) set_h_errno(newval)
>    #else
>    #define SET_H_ERRNO(newval) h_errno = (newval)
>   +#endif
>   +#else
>   +#define SET_H_ERRNO(newval)
>    #endif

I missed something somewhere.  Doesn't the h_errno correspond to
network errors?  Whomever introduced the h_errno foo into sa_common
seems to have missed this bit of apr_errno, which I'd ask that we finally
revisit so the behavior is consistent.

/**
  * @def apr_get_os_error()
  * @return apr_status_t the last platform error, folded into apr_status_t, 
on some platforms
  * @remark This retrieves errno, or calls a GetLastError() style function, and
  *      folds it with APR_FROM_OS_ERROR.  Some platforms (such as OS2) have no
  *      such mechanism, so this call may be unsupported.  Some platforms
  *      require the alternate apr_get_netos_error() to retrieve the last
  *      socket error.
  */
#define apr_get_os_error()   (APR_FROM_OS_ERROR(GetLastError()))

/**
  * Return the last socket error, folded into apr_status_t, on some platforms
  * @deffunc apr_status_t apr_get_netos_error()
  * @tip This retrieves errno, h_errno, or calls a GetLastSocketError() style
  *      function, and folds it with APR_FROM_OS_ERROR.  Some platforms (such
  *      as OS2) have no such mechanism, so this call may be unsupported.
  */

#define apr_get_netos_error()   (APR_FROM_OS_ERROR(WSAGetLastError()))