summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2001-08-29 15:20:24 +0000
committerJeff Trawick <trawick@apache.org>2001-08-29 15:20:24 +0000
commit9c84a09d2b65c273d03520134ba9a15e0515ca8a (patch)
treea54d9e4a23c045a295698aa4bec0016f728572f8 /misc
parentd8126851ace8e5e87416a28a81a0667b7fc13bfb (diff)
downloadapr-9c84a09d2b65c273d03520134ba9a15e0515ca8a.tar.gz
Error codes from getaddrinfo() need their own range within the
apr_status_t layout. This is used to fix the bungling of these error codes. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62243 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc')
-rw-r--r--misc/unix/errorcodes.c11
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);