From: Jeff Trawick Date: Sun, 23 Apr 2000 13:22:08 +0000 (+0000) Subject: Fix some problems on systems where EAGAIN != EWOULDBLOCK (e.g., OS/390). X-Git-Tag: APACHE_2_0_ALPHA_3~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3548f16478f04bf997cfd8f6a105ad6ba63b9ebc;p=thirdparty%2Fapache%2Fhttpd.git Fix some problems on systems where EAGAIN != EWOULDBLOCK (e.g., OS/390). ap_canonical_errror() for Unix now maps EWOULDBLOCK to EAGAIN/APR_EAGAIN when appropriate so that the changes here (as well as bjh's changes from a few days ago) to call ap_canonical_error() before comparing with EWOULDBLOCK will work on Unix as well. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85019 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 69003d92e8b..77aecaf2c05 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2272,7 +2272,7 @@ API_EXPORT(size_t) ap_send_mmap(ap_mmap_t *mm, request_rec *r, size_t offset, else if (rv != APR_SUCCESS) { if (r->connection->aborted) break; - else if (rv == EAGAIN) + else if (ap_canonical_error(rv) == APR_EAGAIN) continue; else { ap_log_rerror(APLOG_MARK, APLOG_INFO, rv, r, diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index f0cf8ae933b..c3e6362e82b 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -681,7 +681,7 @@ static void check_pipe_of_death(void) char pipe_read_char; ret = read(listenfds[0].fd, &pipe_read_char, 1); - if (ret == -1 && errno == EAGAIN) { + if (ret == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index ee0025c6a11..6c1c92b1bda 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -637,7 +637,7 @@ static void check_pipe_of_death(void) int n=1; ret = ap_recv(listensocks[0], &pipe_read_char, &n); - if (ret == APR_EAGAIN) { + if (ap_canonical_error(ret) == APR_EAGAIN) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ }