httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject Re: Change to Error logging routines.
Date Thu, 21 Oct 1999 15:39:18 GMT
On Thu, 21 Oct 1999 11:22:29 -0400, Bill Stoddard wrote:

>> In the OS/2 header files there's a constant ERROR_USER_DEFINED_BASE (set
>> 0xFF00) which all system error codes are less than. I'm not sure what you
>> guys are getting at though, I can't see what use it would be for APR
>> functions to return system error codes as nothing would understand them.

>The idea is to place APR (i.e. user specific) error codes in the user range
>on each OS. This would mean, for example, that APR_SUCCESS would have a
>different numerical value, depending on the OS. Or saying it another way,
>the APR error codes would be offset, in an OS specific way, to put them in
>the user error code space suitable for that OS.  It is important to keep the
>system error codes because in general, it is impossible to map all possible
>system error codes to APR codes with out loosing information. The
>ap_log_error function will have the smarts, based on the error number, to
>determine if the error is an APR status or a system status and do the right

Ok, being able to report system error messages is a great goal but for all
other purposes it reduces the usefulness of the error code to that of a
boolean success/fail indicator.

>> I can't see what use it would be for APR functions to return system error
>codes as nothing would understand them.
>This is not a big issue I think. Most of the time you are checking for
>APR_SUCCESS. If you don't get it, you cut an error message and stop whatever
>it is you are doing. There are few places in Apache that take multiple
>branches based on an return codes.

Most, maybe, but sometimes you really want to behave differently depending on
which error occurred, often to distinguish between fatal & non-fatal errors.

Perhaps something like my os2errno() function could become a public API, say 
int ap_status_errno(ap_status_t);
that could be used to map the system error codes to errno values when you
actually want to know what type of error occurred.

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message