apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Basant Kukreja <Basant.Kukr...@Sun.COM>
Subject Re: apr_pollset_poll return value (APR_EINTR) on solaris
Date Tue, 12 Feb 2008 21:26:46 GMT
After incorporating the sugestion by Lucian, the following patch works for me.

-----------------------------------------------------------------------------
--- orghttpd-2.2.6/srclib/apr/poll/unix/port.c  Fri Apr 13 13:54:13 2007
+++ httpd-2.2.6/srclib/apr/poll/unix/port.c     Tue Feb 12 13:12:38 2008
@@ -295,12 +295,7 @@

     if (ret == -1) {
         (*num) = 0;
-        if (errno == ETIME || errno == EINTR) {
-            rv = APR_TIMEUP;
-        }
-        else {
-            rv = APR_EGENERAL;
-        }
+        rv = apr_get_netos_error();
     }
     else if (nget == 0) {
         rv = APR_TIMEUP;
-----------------------------------------------------------------------------

Regards,
Basant.


On Tue, Feb 12, 2008 at 04:10:32PM -0500, Jim Jagielski wrote:
>
> On Feb 12, 2008, at 3:18 PM, Lucian Adrian Grijincu wrote:
>
>> This is the code in question.
>>
>>    if (ret == -1) {
>>        (*num) = 0;
>>        if (errno == ETIME || errno == EINTR) {
>>            rv = APR_TIMEUP;
>>        }
>>        else {
>>            rv = APR_EGENERAL;
>>        }
>>    }
>>
>> I don't really like the APR_EGENERAL in the else either.
>> Shouldn't this be something like:
>> if (ret == -1)
>> {
>>   (*num) = 0;
>>   rv = apr_get_netos_error();
>> }
>>
>> and let apr_get_netos_error handle OS to APR errors consistent with
>> other architectures (select.c, poll.c)
>>
>
> +1
>
> Basant, can you confirm this works as expected?
>

Mime
View raw message