diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/unix/errorcodes.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c index caea40ca6..b33a0835a 100644 --- a/misc/unix/errorcodes.c +++ b/misc/unix/errorcodes.c @@ -365,8 +365,19 @@ APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, else if (statcode < APR_OS_START_USEERR) { return stuffbuffer(buf, bufsize, apr_error_string(statcode)); } + else if (statcode < APR_OS_START_EAIERR) { + return stuffbuffer(buf, bufsize, "APR does not understand this error code"); + } else if (statcode < APR_OS_START_SYSERR) { +#if defined(HAVE_GETADDRINFO) + statcode -= APR_OS_START_EAIERR; +#if defined(NEGATIVE_EAI) + statcode = -statcode; +#endif + return stuffbuffer(buf, bufsize, gai_strerror(statcode)); +#else return stuffbuffer(buf, bufsize, "APR does not understand this error code"); +#endif } else { return apr_os_strerror(buf, bufsize, statcode - APR_OS_START_SYSERR); |