martin 02/01/29 00:37:45
Modified: network_io/unix sa_common.c
Log:
De facto implementations of getnameinfo() return the error code in their
return value. See isc.org's bind9, or FreeBSD's lib/libc/net/getnameinfo.c
Implementations that set h_errno a simply broken.
Revision Changes Path
1.48 +11 -0 apr/network_io/unix/sa_common.c
Index: sa_common.c
===================================================================
RCS file: /home/cvs/apr/network_io/unix/sa_common.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- sa_common.c 26 Dec 2001 21:18:26 -0000 1.47
+++ sa_common.c 29 Jan 2002 08:37:45 -0000 1.48
@@ -524,6 +524,16 @@
flags != 0 ? flags : NI_NAMEREQD);
if (rc != 0) {
*hostname = NULL;
+#if 1
+ /* De facto implementations return the error code in their
+ * return value. See isc.org's bind9, or
+ * FreeBSD's lib/libc/net/getnameinfo.c
+ * Implementations that set h_errno a simply broken.
+ * @@ if you encounter one, replace the #if 1 by an
+ * @@ appropriate #ifdef and delete these lines.
+ */
+ return rc + APR_OS_START_SYSERR;
+#else
/* XXX I have no idea if this is okay. I don't see any info
* about getnameinfo() returning anything other than good or bad.
*/
@@ -533,6 +543,7 @@
else {
return APR_NOTFOUND;
}
+#endif
}
*hostname = sockaddr->hostname = apr_pstrdup(sockaddr->pool,
tmphostname);