httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject Re: Errno code in APR again.
Date Thu, 06 Apr 2000 18:43:09 GMT

Well, first of all this is ugly.  But there is no help for that.  The fact
is that most unix's define these two values to be the same.  If there are
some IMHO brain-dead unix's that don't, we have a way to fix this.  The
changes are added inline below.

> define EWOULDBLOCK to EAGAIN.  Hopefully the optimizer will collapse
> (errno == EAGAIN || errno == EWOULDBLOCK) when EAGAIN and EWOULDBLOCK
> are the same.)

I doubt it will.

> 
> /* a wrapper around iol_read which checks for errors and EOFs */
> static ap_status_t read_with_errors(BUFF *fb, void *buf, ap_size_t
> nbyte,
>                                     ap_ssize_t *bytes_read)
> {
>     ap_status_t rv;
> 
>     rv = iol_read(fb->iol, buf, nbyte, bytes_read);
>     if (rv == APR_SUCCESS && *bytes_read == 0) {
>         fb->flags |= B_EOF;
>     }
>     else if (rv != APR_SUCCESS) {
>         fb->berrno = rv;
>         fb->saved_errno = rv;
#if BRAIN_DEAD_UNIX
          rv = ap_canonical_error(rv);
#endif
>         if (rv != APR_EAGAIN) {
>             doerror(fb, B_RD);
>         }
>     }
>     return rv;
> }

Done.

Ryan
_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message