Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 10039 invoked by uid 500); 4 Oct 2000 06:09:51 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 10017 invoked from network); 4 Oct 2000 06:09:50 -0000 Errors-To: From: "William A. Rowe, Jr." To: Subject: [s/rant/patch/] os/cannonical error Date: Wed, 4 Oct 2000 01:09:46 -0500 Message-ID: <001c01c02dc9$b3afe760$92c0b0d0@roweclan.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001D_01C02D9F.CAD9DF60" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 In-Reply-To: Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_001D_01C02D9F.CAD9DF60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Ok... here's the proposal, without the massive changes required to actually replace every occurance of the original tests throughout the code. I've simply taken [most] of the canonical_error conversions and shifted them to their appropriate macro. Unix... please pay attention to the APR_ERROR_IS_EAGAIN and APR_EAGAIN declarations, and their relationship to EAGAIN and EWOULDBLOCK. I could have blown it completely, but I gather this is correct. OS2... I gathered and inferred what I could from the sources. It really illustrates the cpu operations flaw of the original design as used by OS2. Win32... I've barely touched the list, the error codes need review. Stolen (almost completely) from OS2. However, this illustrates the simplicity of using the system's own error codes 'in place', without any transform. I can keep or lose APR's own status/error code macro tests, I simply implemented every code as a macro. Not sure here if something will later pop up as an issue (e.g. an APR_EOF equivilant result code.) Please vote on these separately from the canonical/os errors proposal. And I certainly don't mind offloading or customizing this file by platform (all that EAGAIN/EWOULDBLOCK could be configure'd in, for example.) But since we don't expect users to step into their platform's include tree, we need to think this through. I'd like to simply get it committed, then we can review. Without any objections, I'll commit tommorow night or Wednesday.. Bill > -----Original Message----- > From: rbb@covalent.net [mailto:rbb@covalent.net] > Sent: Wednesday, September 20, 2000 1:45 PM > To: new-httpd@apache.org > Subject: Re: [rant] os/cannonical error > > > > This makes sense to me. Of course, instead of the 500 line case > statement, we have 500 lines of #defines. Hmmmmmm....... > Those #defines > could be in a simple per-platform header file, so it wouldn't > really be > that bad. > > +1 > > Ryan > > On Wed, 20 Sep 2000, William A. Rowe, Jr. wrote: > > > The last post just reminded me... > > > > MUST we be adding cpu cycles to flip OS errors to native ERRNO > > values in canonerr.c!?! I'm looking forward to the day we have > > a 500 condition-long switch block. -not-. > > > > I've suggested a very long time ago... let's take the EAGAIN > > error just for kicks. Why not a simple, compile-time macro to > > deal with this. Unix: > > > > #define APR_IS_EAGAIN(e) ((e) == APR_EAGAIN) > > > > Gee. No CPU cycles wasted. Windows? > > > > #define APR_IS_EAGAIN(e) (((e) == APR_EAGAIN) || (e) == > WSAEWOULDBLOCK) > > > > Ohhh... a whole extra few cycles. Not an entire switch block full > > of them, however. > > > > If we realize a new API specific error on any platform... > just add it > > to the (now growing) list of equivilant errors. Keep APR's > list rather > > short and sweet, and track the dozens of 'equivilant' errors using > > the macro. Very readable, I think... > > > > if (stat != APR_SUCCESS && > > !(APR_IS_EINPROGRESS(stat) || > > APR_IS_EAGAIN(stat))) { > > apr_close_socket(sock); > > fprintf(stderr, "Could not connect: %s (%d)\n", > > apr_strerror(stat, msgbuf, sizeof(msgbuf)), stat); > > > > I don't think this is all that ungodly... but a 500 error > case statement > > will be, someday in the (near?) future. ------=_NextPart_000_001D_01C02D9F.CAD9DF60 Content-Type: text/plain; name="errormacros.diffs" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="errormacros.diffs" Index: src/lib/apr/include/apr_errno.h =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_errno.h,v retrieving revision 1.38 diff -u -r1.38 apr_errno.h --- src/lib/apr/include/apr_errno.h 2000/08/02 05:26:03 1.38 +++ src/lib/apr/include/apr_errno.h 2000/10/04 05:50:32 @@ -109,7 +109,7 @@ * APR_ENOLOCK APR was not given a lock structure * APR_ENOPOLL APR was not given a poll structure * APR_ENOSOCKET APR was not given a socket - * APR_ENOTHREAD APR was nto given a thread structure + * APR_ENOTHREAD APR was not given a thread structure * APR_ENOTHDKEY APR was not given a thread key structure * APR_ENOSHMAVAIL There is no more shared memory available * APR_EDSOOPEN APR was unable to open the dso object. For more @@ -166,6 +166,29 @@ /* empty slot: +18 */ #define APR_EDSOOPEN (APR_OS_START_ERROR + 19) + +/* APR ERROR VALUE TESTS */ +#define APR_STATUS_IS_ENOSTAT(s) ((s) == APR_ENOSTAT) +#define APR_STATUS_IS_ENOPOOL(s) ((s) == APR_ENOPOOL) +#define APR_STATUS_IS_ENOFILE(s) ((s) == APR_ENOFILE) +#define APR_STATUS_IS_EBADDATE(s) ((s) == APR_EBADDATE) +#define APR_STATUS_IS_EINVALSOCK(s) ((s) == APR_EINVALSOCK) +#define APR_STATUS_IS_ENOPROC(s) ((s) == APR_ENOPROC) +#define APR_STATUS_IS_ENOTIME(s) ((s) == APR_ENOTIME) +#define APR_STATUS_IS_ENODIR(s) ((s) == APR_ENODIR) +#define APR_STATUS_IS_ENOLOCK(s) ((s) == APR_ENOLOCK) +#define APR_STATUS_IS_ENOPOLL(s) ((s) == APR_ENOPOLL) +#define APR_STATUS_IS_ENOSOCKET(s) ((s) == APR_ENOSOCKET) +#define APR_STATUS_IS_ENOTHREAD(s) ((s) == APR_ENOTHREAD) +#define APR_STATUS_IS_ENOTHDKEY(s) ((s) == APR_ENOTHDKEY) +/* empty slot: +14 */ +#define APR_STATUS_IS_ENOSHMAVAIL(s) ((s) == APR_ENOSHMAVAIL) +/* empty slot: +16 */ +/* empty slot: +17 */ +/* empty slot: +18 */ +#define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN) + + /* APR STATUS VALUES */ #define APR_INCHILD (APR_OS_START_STATUS + 1) #define APR_INPARENT (APR_OS_START_STATUS + 2) @@ -188,20 +211,38 @@ #define APR_ANONYMOUS (APR_OS_START_STATUS + 19) #define APR_FILEBASED (APR_OS_START_STATUS + 20) #define APR_KEYBASED (APR_OS_START_STATUS + 21) - -/* A simple value to be used to initialize a status variable. */ #define APR_EINIT (APR_OS_START_STATUS + 22) - -/* Not implemented either because we haven't gotten to it yet, or - * because it is not possible to do correctly. - */ #define APR_ENOTIMPL (APR_OS_START_STATUS + 23) - -/* Passwords do not match. - */ #define APR_EMISMATCH (APR_OS_START_STATUS + 24) +/* APR STATUS VALUE TESTS */ +#define APR_STATUS_IS_INCHILD(s) ((s) == APR_INCHILD) +#define APR_STATUS_IS_INPARENT(s) ((s) == APR_INPARENT) +#define APR_STATUS_IS_DETACH(s) ((s) == APR_DETACH) +#define APR_STATUS_IS_NOTDETACH(s) ((s) == APR_NOTDETACH) +#define APR_STATUS_IS_CHILD_DONE(s) ((s) == APR_CHILD_DONE) +#define APR_STATUS_IS_CHILD_NOTDONE(s) ((s) == APR_CHILD_NOTDONE) +#define APR_STATUS_IS_TIMEUP(s) ((s) == APR_TIMEUP) +#define APR_STATUS_IS_INCOMPLETE(s) ((s) == APR_INCOMPLETE) +/* empty slot: +9 */ +/* empty slot: +10 */ +/* empty slot: +11 */ +#define APR_STATUS_IS_BADCH(s) ((s) == APR_BADCH) +#define APR_STATUS_IS_BADARG(s) ((s) == APR_BADARG) +#define APR_STATUS_IS_EOF(s) ((s) == APR_EOF) +#define APR_STATUS_IS_NOTFOUND(s) ((s) == APR_NOTFOUND) +/* empty slot: +16 */ +/* empty slot: +17 */ +/* empty slot: +18 */ +#define APR_STATUS_IS_ANONYMOUS(s) ((s) == APR_ANONYMOUS) +#define APR_STATUS_IS_FILEBASED(s) ((s) == APR_FILEBASED) +#define APR_STATUS_IS_KEYBASED(s) ((s) == APR_KEYBASED) +#define APR_STATUS_IS_EINIT(s) ((s) == APR_EINIT) +#define APR_STATUS_IS_ENOTIMPL(s) ((s) == APR_ENOTIMPL) +#define APR_STATUS_IS_EMISMATCH(s) ((s) == APR_EMISMATCH) + + /* APR CANONICAL ERROR VALUES */ #ifdef EACCES #define APR_EACCES EACCES @@ -277,6 +318,8 @@ #ifdef EAGAIN #define APR_EAGAIN EAGAIN +#elif defined(EWOULDBLOCK) +#define APR_EAGAIN EWOULDBLOCK #else #define APR_EAGAIN (APR_OS_START_CANONERR + 13) #endif @@ -304,6 +347,163 @@ #else #define APR_EINPROGRESS (APR_OS_START_CANONERR + 17) #endif + + +#if !defined(OS2) && !defined(WIN32) + + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE) +#if !defined(EWOULDBLOCK) || !defined(EAGAIN) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) +#elif (EWOULDBLOCK == EAGAIN) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN) +#else +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN || (s) == EWOULDBLOCK) +#endif +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS) + + +#elif defined(OS2) /* endif !defined(WIN32) && !defined(OS2) */ + + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS \ + || (s) - APR_OS_START_SYSERR == NO_ERROR) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ + || (s) - APR_OS_START_SYSERR == ERROR_ACCESS_DENIED \ + || (s) - APR_OS_START_SYSERR == ERROR_SHARING_VIOLATION) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ + || (s) - APR_OS_START_SYSERR == ERROR_FILENAME_EXCED_RANGE \ + || (s) - APR_OS_START_SYSERR == SOCENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ + || (s) - APR_OS_START_SYSERR == ERROR_FILE_NOT_FOUND \ + || (s) - APR_OS_START_SYSERR == ERROR_PATH_NOT_FOUND \ + || (s) - APR_OS_START_SYSERR == ERROR_OPEN_FAILED) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ + || (s) - APR_OS_START_SYSERR == ERROR_DISK_FULL) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ + || (s) - APR_OS_START_SYSERR == ERROR_TOO_MANY_OPEN_FILES) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ + || (s) - APR_OS_START_SYSERR == ERROR_INVALID_HANDLE) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ + || (s) - APR_OS_START_SYSERR == ERROR_INVALID_PARAMETER \ + || (s) - APR_OS_START_SYSERR == ERROR_INVALID_FUNCTION) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ + || (s) - APR_OS_START_SYSERR == ERROR_NEGATIVE_SEEK) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) - APR_OS_START_SYSERR == ERROR_NO_DATA \ + || (s) - APR_OS_START_SYSERR == SOCEWOULDBLOCK) +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ + || (s) - APR_OS_START_SYSERR == SOCEINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ + || (s) - APR_OS_START_SYSERR == SOCENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ + || (s) - APR_OS_START_SYSERR == SOCECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ + || (s) - APR_OS_START_SYSERR == SOCEINPROGRESS) + +/* + Sorry, too tired to wrap this up for OS2... feel free to + fit the following into their best matches. + + { ERROR_NO_SIGNAL_SENT, ESRCH }, + { SOCEALREADY, EALREADY }, + { SOCEDESTADDRREQ, EDESTADDRREQ }, + { SOCEMSGSIZE, EMSGSIZE }, + { SOCEPROTOTYPE, EPROTOTYPE }, + { SOCENOPROTOOPT, ENOPROTOOPT }, + { SOCEPROTONOSUPPORT, EPROTONOSUPPORT }, + { SOCESOCKTNOSUPPORT, ESOCKTNOSUPPORT }, + { SOCEOPNOTSUPP, EOPNOTSUPP }, + { SOCEPFNOSUPPORT, EPFNOSUPPORT }, + { SOCEAFNOSUPPORT, EAFNOSUPPORT }, + { SOCEADDRINUSE, EADDRINUSE }, + { SOCEADDRNOTAVAIL, EADDRNOTAVAIL }, + { SOCENETDOWN, ENETDOWN }, + { SOCENETUNREACH, ENETUNREACH }, + { SOCENETRESET, ENETRESET }, + { SOCECONNABORTED, ECONNABORTED }, + { SOCECONNRESET, ECONNRESET }, + { SOCENOBUFS, ENOBUFS }, + { SOCEISCONN, EISCONN }, + { SOCENOTCONN, ENOTCONN }, + { SOCESHUTDOWN, ESHUTDOWN }, + { SOCETOOMANYREFS, ETOOMANYREFS }, + { SOCETIMEDOUT, ETIMEDOUT }, + { SOCELOOP, ELOOP }, + { SOCEHOSTDOWN, EHOSTDOWN }, + { SOCEHOSTUNREACH, EHOSTUNREACH }, + { SOCENOTEMPTY, ENOTEMPTY }, + { SOCEPIPE, EPIPE } +*/ + +#elif defined(WIN32) /* endif defined(OS2) */ + + +#define APR_STATUS_IS_SUCCESS ((s) == APR_SUCCESS) + +/* APR CANONICAL ERROR TESTS */ +#define APR_STATUS_IS_EACCES(s) ((s) == APR_EACCES \ + || (s) == ERROR_ACCESS_DENIED \ + || (s) == ERROR_SHARING_VIOLATION) +#define APR_STATUS_IS_EEXIST(s) ((s) == APR_EEXIST) +#define APR_STATUS_IS_ENAMETOOLONG(s) ((s) == APR_ENAMETOOLONG \ + || (s) == ERROR_FILENAME_EXCED_RANGE \ + || (s) == WSAENAMETOOLONG) +#define APR_STATUS_IS_ENOENT(s) ((s) == APR_ENOENT \ + || (s) == ERROR_FILE_NOT_FOUND \ + || (s) == ERROR_PATH_NOT_FOUND \ + || (s) == ERROR_OPEN_FAILED) +#define APR_STATUS_IS_ENOTDIR(s) ((s) == APR_ENOTDIR) +#define APR_STATUS_IS_ENOSPC(s) ((s) == APR_ENOSPC \ + || (s) == ERROR_DISK_FULL) +#define APR_STATUS_IS_ENOMEM(s) ((s) == APR_ENOMEM) +#define APR_STATUS_IS_EMFILE(s) ((s) == APR_EMFILE \ + || (s) == ERROR_TOO_MANY_OPEN_FILES) +#define APR_STATUS_IS_ENFILE(s) ((s) == APR_ENFILE) +#define APR_STATUS_IS_EBADF(s) ((s) == APR_EBADF \ + || (s) == ERROR_INVALID_HANDLE) +#define APR_STATUS_IS_EINVAL(s) ((s) == APR_EINVAL \ + || (s) == ERROR_INVALID_PARAMETER \ + || (s) == ERROR_INVALID_FUNCTION) +#define APR_STATUS_IS_ESPIPE(s) ((s) == APR_ESPIPE \ + || (s) == ERROR_NEGATIVE_SEEK) +#define APR_STATUS_IS_EAGAIN(s) ((s) == APR_EAGAIN \ + || (s) == ERROR_NO_DATA \ + || (s) == WSAEWOULDBLOCK) +#define APR_STATUS_IS_EINTR(s) ((s) == APR_EINTR \ + || (s) == WSAEINTR) +#define APR_STATUS_IS_ENOTSOCK(s) ((s) == APR_ENOTSOCK \ + || (s) == WSAENOTSOCK) +#define APR_STATUS_IS_ECONNREFUSED(s) ((s) == APR_ECONNREFUSED \ + || (s) == WSAECONNREFUSED) +#define APR_STATUS_IS_EINPROGRESS(s) ((s) == APR_EINPROGRESS \ + || (s) == WSAEINPROGRESS) + +#endif /* endif defined(WIN32) */ + #ifdef __cplusplus } Index: src/lib/apr/test/testsf.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testsf.c,v retrieving revision 1.8 diff -u -r1.8 testsf.c --- src/lib/apr/test/testsf.c 2000/09/12 23:15:36 1.8 +++ src/lib/apr/test/testsf.c 2000/10/04 05:50:43 @@ -350,7 +350,7 @@ rv = apr_sendfile(sock, f, &hdtr, ¤t_file_offset, &tmplen, 0); printf("apr_sendfile()->%d, sent %ld bytes\n", rv, (long)tmplen); if (rv) { - if (apr_canonical_error(rv) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(rv)) { nsocks = 1; tmprv = apr_poll(pfd, &nsocks, -1); assert(!tmprv); @@ -417,7 +417,7 @@ } while (total_bytes_sent < expected_len && (rv == APR_SUCCESS || - apr_canonical_error(rv) == APR_EAGAIN)); + APR_STATUS_IS_EAGAIN(rv))); if (total_bytes_sent != expected_len) { fprintf(stderr, "client problem: sent %ld of %ld bytes\n", Index: src/lib/apr/threadproc/os2/proc.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/os2/proc.c,v retrieving revision 1.30 diff -u -r1.30 proc.c --- src/lib/apr/threadproc/os2/proc.c 2000/08/06 16:35:56 1.30 +++ src/lib/apr/threadproc/os2/proc.c 2000/10/04 05:50:44 @@ -350,7 +350,7 @@ } else if (stricmp(extension, ".exe") != 0) { status = apr_open(&progfile, progname, APR_READ|APR_BUFFERED, 0, cont); - if (status != APR_SUCCESS && apr_canonical_error(status) == APR_ENOENT) { + if (status != APR_SUCCESS && APR_STATUS_IS_ENOENT(status)) { progname = apr_pstrcat(cont, progname, ".exe", NULL); } Index: src/main/buff.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/buff.c,v retrieving revision 1.62 diff -u -r1.62 buff.c --- src/main/buff.c 2000/09/10 20:45:16 1.62 +++ src/main/buff.c 2000/10/04 05:50:47 @@ -391,7 +391,7 @@ /* we'll read the next packet if it's available */ fb->inptr = fb->inbase; rv = saferead(fb, fb->inptr, fb->bufsiz, &fb->incnt); - if (rv != APR_SUCCESS && apr_canonical_error(rv) != APR_EAGAIN) { + if (rv != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(rv)) { fb->berrno = rv; fb->saved_errno = rv; doerror(fb, B_RD); @@ -419,7 +419,7 @@ else if (rv != APR_SUCCESS) { fb->berrno = rv; fb->saved_errno = rv; - if (apr_canonical_error(rv) != APR_EAGAIN) { + if (!APR_STATUS_IS_EAGAIN(rv)) { doerror(fb, B_RD); } } @@ -694,7 +694,7 @@ if (rv != APR_SUCCESS) { /* ### set berrno? */ fb->saved_errno = rv; - if (apr_canonical_error(rv) != APR_EAGAIN) { + if (!APR_STATUS_IS_EAGAIN(rv)) { doerror(fb, B_WR); } } @@ -828,7 +828,7 @@ if (rv != APR_SUCCESS) { /* ### set berrno? */ fb->saved_errno = rv; - if (apr_canonical_error(rv) != APR_EAGAIN) { + if (!APR_STATUS_IS_EAGAIN(rv)) { doerror(fb, B_WR); } } Index: src/main/http_config.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_config.c,v retrieving revision 1.77 diff -u -r1.77 http_config.c --- src/main/http_config.c 2000/09/20 17:35:59 1.77 +++ src/main/http_config.c 2000/10/04 05:50:47 @@ -1447,9 +1447,7 @@ *result = dc; break; } else { - apr_status_t cerr = apr_canonical_error(status); - - if (cerr != APR_ENOENT && cerr != APR_ENOTDIR) { + if (!APR_STATUS_IS_ENOENT(status) && !APR_STATUS_IS_ENOTDIR(status)) { ap_log_rerror(APLOG_MARK, APLOG_CRIT, status, r, "%s pcfg_openfile: unable to check htaccess file, " "ensure it is readable", Index: src/main/http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.135 diff -u -r1.135 http_protocol.c --- src/main/http_protocol.c 2000/10/03 22:08:38 1.135 +++ src/main/http_protocol.c 2000/10/04 05:50:48 @@ -2715,7 +2715,7 @@ (void) ap_rflush(r); break; } - else if (apr_canonical_error(read_rv) != APR_EAGAIN) { + else if (!APR_STATUS_IS_EAGAIN(read_rv)) { r->connection->aborted = 1; break; } Index: src/main/http_request.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v retrieving revision 1.51 diff -u -r1.51 http_request.c --- src/main/http_request.c 2000/09/23 18:39:30 1.51 +++ src/main/http_request.c 2000/10/04 05:50:49 @@ -210,7 +210,7 @@ char *path = r->filename; char *end = &path[strlen(path)]; char *last_cp = NULL; - int rv, rvc; + int rv; #ifdef HAVE_DRIVE_LETTERS char bStripSlash=1; #endif @@ -301,10 +301,9 @@ * even if they returned an error. */ r->finfo.protection = 0; - rvc = apr_canonical_error(rv); #if defined(APR_ENOENT) && defined(APR_ENOTDIR) - if (rvc == APR_ENOENT || rvc == APR_ENOTDIR) { + if (APR_STATUS_IS_ENOENT(rv) || APR_STATUS_IS_ENOTDIR(rv)) { last_cp = cp; while (--cp > path && *cp != '/') @@ -315,14 +314,14 @@ } else { #if defined(APR_EACCES) - if (rvc != APR_EACCES) + if (APR_STATUS_IS_EACCES(rv)) #endif ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, "access to %s failed", r->uri); return HTTP_FORBIDDEN; } #else -#error ENOENT || ENOTDIR not defined; please see the +#error APR_ENOENT || APR_ENOTDIR not defined; please see the #error comments at this line in the source for a workaround. /* * If ENOENT || ENOTDIR is not defined in one of the your OS's @@ -344,7 +343,7 @@ while (cp > path && cp[-1] == '/') --cp; -#endif /* ENOENT && ENOTDIR */ +#endif /* APR_ENOENT && APR_ENOTDIR */ } return OK; } Index: src/main/mpm_common.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/mpm_common.c,v retrieving revision 1.33 diff -u -r1.33 mpm_common.c --- src/main/mpm_common.c 2000/08/22 15:09:24 1.33 +++ src/main/mpm_common.c 2000/10/04 05:50:49 @@ -191,11 +191,11 @@ #endif } rv = apr_wait_all_procs(ret, status, APR_NOWAIT, p); - if (apr_canonical_error(rv) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(rv)) { ret->pid = -1; return; } - if (rv == APR_CHILD_DONE) { + if (APR_STATUS_IS_CHILD_DONE(rv)) { return; } #ifdef NEED_WAITPID Index: src/main/rfc1413.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/rfc1413.c,v retrieving revision 1.21 diff -u -r1.21 rfc1413.c --- src/main/rfc1413.c 2000/08/07 19:26:00 1.21 +++ src/main/rfc1413.c 2000/10/04 05:50:49 @@ -168,7 +168,7 @@ apr_ssize_t j = strlen(buffer + i); apr_status_t status; status = apr_send(sock, buffer+i, &j); - if (status != APR_SUCCESS && apr_canonical_error(status) != APR_EINTR) { + if (status != APR_SUCCESS && !APR_STATUS_IS_EINTR(status)) { ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv, "write: rfc1413: error sending request"); return -1; @@ -194,7 +194,7 @@ apr_ssize_t j = sizeof(buffer) - 1 - i; apr_status_t status; status = apr_recv(sock, buffer+i, &j); - if (status != APR_SUCCESS && apr_canonical_error(status) != APR_EINTR) { + if (status != APR_SUCCESS && !APR_STATUS_IS_EINTR(status)) { ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv, "read: rfc1413: error reading response"); return -1; Index: src/modules/mpm/dexter/dexter.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/dexter/dexter.c,v retrieving revision 1.125 diff -u -r1.125 dexter.c --- src/modules/mpm/dexter/dexter.c 2000/08/23 00:01:53 1.125 +++ src/modules/mpm/dexter/dexter.c 2000/10/04 05:50:57 @@ -481,7 +481,7 @@ apr_ssize_t n = 1; ret = apr_recv(listenfds[0], &pipe_read_char, &n); - if (apr_canonical_error(ret) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(ret)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } @@ -555,7 +555,7 @@ srv = apr_poll(pollset, &n, -1); if (srv != APR_SUCCESS) { - if (apr_canonical_error(srv) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(srv)) { continue; } @@ -1112,7 +1112,7 @@ /* give the children the signal to die */ for (i = 0; i < num_daemons;) { if ((rv = apr_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINTR) continue; + if (APR_STATUS_IS_EINTR(rv)) continue; ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death"); } Index: src/modules/mpm/mpmt_pthread/mpmt_pthread.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v retrieving revision 1.120 diff -u -r1.120 mpmt_pthread.c --- src/modules/mpm/mpmt_pthread/mpmt_pthread.c 2000/08/23 00:01:54 1.120 +++ src/modules/mpm/mpmt_pthread/mpmt_pthread.c 2000/10/04 05:50:57 @@ -432,7 +432,7 @@ apr_ssize_t n = 1; ret = apr_recv(listensocks[0], &pipe_read_char, &n); - if (apr_canonical_error(ret) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(ret)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } @@ -498,7 +498,7 @@ ret = apr_poll(pollset, &n, -1); if (ret != APR_SUCCESS) { - if (apr_canonical_error(ret) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(ret)) { continue; } @@ -1133,7 +1133,7 @@ /* give the children the signal to die */ for (i = 0; i < ap_daemons_limit;) { if ((rv = apr_write(pipe_of_death_in, &char_of_death, &one)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINTR) continue; + if (APR_STATUS_IS_EINTR(rv)) continue; ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death"); } i++; Index: src/modules/mpm/perchild/perchild.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/perchild/perchild.c,v retrieving revision 1.20 diff -u -r1.20 perchild.c --- src/modules/mpm/perchild/perchild.c 2000/08/23 00:01:55 1.20 +++ src/modules/mpm/perchild/perchild.c 2000/10/04 05:50:58 @@ -518,7 +518,7 @@ apr_ssize_t n = 1; ret = apr_recv(listenfds[0], &pipe_read_char, &n); - if (apr_canonical_error(ret) == APR_EAGAIN) { + if (APR_STATUS_IS_EAGAIN(ret)) { /* It lost the lottery. It must continue to suffer * through a life of servitude. */ } @@ -593,7 +593,7 @@ srv = apr_poll(pollset, &n, -1); if (srv != APR_SUCCESS) { - if (apr_canonical_error(srv) == APR_EINTR) { + if (APR_STATUS_IS_EINTR(srv)) { continue; } @@ -1272,7 +1272,7 @@ /* give the children the signal to die */ for (i = 0; i < num_daemons;) { if ((rv = apr_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINTR) continue; + if (APR_STATUS_IS_EINTR(rv)) continue; ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death"); } Index: src/support/ab.c =================================================================== RCS file: /home/cvs/apache-2.0/src/support/ab.c,v retrieving revision 1.27 diff -u -r1.27 ab.c --- src/support/ab.c 2000/09/14 18:42:58 1.27 +++ src/support/ab.c 2000/10/04 05:51:01 @@ -498,7 +498,7 @@ } c->start = apr_now(); if ((rv = apr_connect(c->aprsock, hostname)) != APR_SUCCESS) { - if (apr_canonical_error(rv) == APR_EINPROGRESS) { + if (APR_STATUS_IS_EINPROGRESS(rv)) { c->state = STATE_CONNECTING; apr_add_poll_socket(readbits, c->aprsock, APR_POLLOUT); return; @@ -574,13 +574,13 @@ r = sizeof(buffer); apr_setsocketopt(c->aprsock, APR_SO_TIMEOUT, aprtimeout); status = apr_recv(c->aprsock, buffer, &r); - if (r == 0 || (status != 0 && apr_canonical_error(status) != APR_EAGAIN)) { + if (r == 0 || (status != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(status))) { good++; close_connection(c); return; } - if (apr_canonical_error(status) == APR_EAGAIN) + if (APR_STATUS_IS_EAGAIN(status)) return; c->read += r; ------=_NextPart_000_001D_01C02D9F.CAD9DF60--