INN commit: trunk (include/portable/socket.h lib/getaddrinfo.c)

INN Commit rra at isc.org
Sat Aug 20 23:23:26 UTC 2011


    Date: Saturday, August 20, 2011 @ 16:23:26
  Author: eagle
Revision: 9357

Move netdb constants from portable/socket.h to lib/getaddrinfo.c

Nothing outside of the getaddrinfo replacement function now needs
any of the netdb.h constants or h_errno, so remove them from
portable/socket.h and move them to lib/getaddrinfo.c.

Modified:
  trunk/include/portable/socket.h
  trunk/lib/getaddrinfo.c

---------------------------+
 include/portable/socket.h |   22 ----------------------
 lib/getaddrinfo.c         |   22 ++++++++++++++++++++++
 2 files changed, 22 insertions(+), 22 deletions(-)

Modified: include/portable/socket.h
===================================================================
--- include/portable/socket.h	2011-08-20 23:15:10 UTC (rev 9356)
+++ include/portable/socket.h	2011-08-20 23:23:26 UTC (rev 9357)
@@ -154,28 +154,6 @@
 # endif /* HAVE_SOCKADDR_LEN */
 #endif /* !HAVE_SA_LEN_MACRO */
 
-/* Make sure we have access to h_errno and hstrerror to print out name
-   resolution error messages. */
-#if !HAVE_DECL_H_ERRNO
-extern int h_errno;
-#endif
-
-/* The netdb constants, which aren't always defined (particularly if h_errno
-   isn't declared.  We also make sure that a few of the less-used ones are
-   defined so that we can deal with them in case statements. */
-#ifndef NETDB_SUCCESS
-# define NETDB_SUCCESS  0
-#endif
-#ifndef HOST_NOT_FOUND
-# define HOST_NOT_FOUND 1
-# define TRY_AGAIN      2
-# define NO_RECOVERY    3
-# define NO_DATA        4
-#endif
-#ifndef NETDB_INTERNAL
-# define NETDB_INTERNAL -1
-#endif
-
 /* AI_ADDRCONFIG results in an error from getaddrinfo on BSD/OS and
    possibly other platforms.  If configure determined it didn't work,
    pretend it doesn't exist. */

Modified: lib/getaddrinfo.c
===================================================================
--- lib/getaddrinfo.c	2011-08-20 23:15:10 UTC (rev 9356)
+++ lib/getaddrinfo.c	2011-08-20 23:23:26 UTC (rev 9357)
@@ -26,6 +26,28 @@
 #include "portable/socket.h"
 #include <errno.h>
 
+/* Make sure we have access to h_errno and hstrerror to print out name
+   resolution error messages. */
+#if !HAVE_DECL_H_ERRNO
+extern int h_errno;
+#endif
+
+/* The netdb constants, which aren't always defined (particularly if h_errno
+   isn't declared.  We also make sure that a few of the less-used ones are
+   defined so that we can deal with them in case statements. */
+#ifndef NETDB_SUCCESS
+# define NETDB_SUCCESS  0
+#endif
+#ifndef HOST_NOT_FOUND
+# define HOST_NOT_FOUND 1
+# define TRY_AGAIN      2
+# define NO_RECOVERY    3
+# define NO_DATA        4
+#endif
+#ifndef NETDB_INTERNAL
+# define NETDB_INTERNAL -1
+#endif
+
 /* If we're running the test suite, rename the functions to avoid conflicts
    with the system version.  Note that we don't rename the structures and
    constants, but that should be okay (except possibly for gai_strerror. */




More information about the inn-committers mailing list