From cvs-return-3976-apmail-apr-cvs-archive=apr.apache.org@apr.apache.org Sun Aug 04 01:35:46 2002 Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 77145 invoked by uid 500); 4 Aug 2002 01:35:46 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 77134 invoked from network); 4 Aug 2002 01:35:46 -0000 Date: 4 Aug 2002 01:35:45 -0000 Message-ID: <20020804013545.86797.qmail@icarus.apache.org> From: wrowe@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/poll/unix poll.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N wrowe 2002/08/03 18:35:45 Modified: include apr_errno.h poll/unix poll.c Log: apr_get_netos_error() must be implemented on all platforms. Aren't you unix folks already having trouble with h_errno v.s. errno? Fix apr_poll to use apr_get_netos_error(). Submitted by: Rob Saccoccio Revision Changes Path 1.94 +7 -1 apr/include/apr_errno.h Index: apr_errno.h =================================================================== RCS file: /home/cvs/apr/include/apr_errno.h,v retrieving revision 1.93 retrieving revision 1.94 diff -u -r1.93 -r1.94 --- apr_errno.h 16 Jul 2002 20:23:48 -0000 1.93 +++ apr_errno.h 4 Aug 2002 01:35:44 -0000 1.94 @@ -906,7 +906,7 @@ #define apr_get_os_error() (APR_FROM_OS_ERROR(GetLastError())) #define apr_set_os_error(e) (SetLastError(APR_TO_OS_ERROR(e))) -/* A special case, only Win32 winsock calls require this: +/* A special case, only socket calls require this: */ #define apr_get_netos_error() (APR_FROM_OS_ERROR(WSAGetLastError())) @@ -1072,6 +1072,12 @@ #define apr_get_os_error() (errno) #define apr_set_os_error(e) (errno = (e)) + +/* A special case, only socket calls require this: + * [Note: platforms using h_errno should replace this macro, + * although watch out for thread saftey issues with h_errno.] + */ +#define apr_get_netos_error() (errno) /** no error */ #define APR_STATUS_IS_SUCCESS(s) ((s) == APR_SUCCESS) 1.25 +4 -4 apr/poll/unix/poll.c Index: poll.c =================================================================== RCS file: /home/cvs/apr/poll/unix/poll.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- poll.c 3 Aug 2002 00:10:57 -0000 1.24 +++ poll.c 4 Aug 2002 01:35:45 -0000 1.25 @@ -172,7 +172,7 @@ #endif if ((*nsds) < 0) { - return errno; + return apr_get_netos_error(); } if ((*nsds) == 0) { return APR_TIMEUP; @@ -270,7 +270,7 @@ return APR_TIMEUP; } if ((*nsds) < 0) { - return errno; + return apr_get_netos_error(); } for (i = 0; i < num; i++) { @@ -513,7 +513,7 @@ rv = poll(pollset->pollset, pollset->nelts, timeout); (*num) = rv; if (rv < 0) { - return errno; + return apr_get_netos_error(); } if (rv == 0) { return APR_TIMEUP; @@ -566,7 +566,7 @@ (*num) = rv; if (rv < 0) { - return errno; + return apr_get_netos_error(); } if (rv == 0) { return APR_TIMEUP;