summary refs log tree commit diff
path: root/nss/getXXbyYY_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-21 21:23:21 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-21 21:23:21 +0000
commita5fdf99b7c4d23acbc3d3f77f6c4d4456ff6006f (patch)
tree50505d8e5c6d5e9a45cffa622461612d11fc369c /nss/getXXbyYY_r.c
parentdf18ec9afef6afd29c3b19bccec35e4dbe4563bf (diff)
downloadglibc-a5fdf99b7c4d23acbc3d3f77f6c4d4456ff6006f.tar.gz
glibc-a5fdf99b7c4d23acbc3d3f77f6c4d4456ff6006f.tar.xz
glibc-a5fdf99b7c4d23acbc3d3f77f6c4d4456ff6006f.zip
Update.
2000-12-09  H.J. Lu  <hjl@gnu.org>

	* nss/Makefile (routines): Add digits_dots.
	* nss/Versions (libc): Add __nss_hostname_digits_dots to GLIBC_2.2.2.
	* nss/digits_dots.c (__nss_hostname_digits_dots): Turn template
	into a function.
	* nss/nsswitch.h (__nss_hostname_digits_dots): New internal NSS
	function.
	* nss/getXXbyYY.c (H_ERRNO_VAR_P): New definition.
	(TYPE_VAR_P): Likewise.
	(FLAGS_VAR): Likewise.
	(AF_VAR_P): Likewise.
	(INTERNAL (REENTRANT_NAME)): Call __nss_hostname_digits_dots ()
	instead of including digits_dots.c.
	* nss/getXXbyYY_r.c (H_ERRNO_VAR_P): New definition.
	(TYPE_VAR_P): Likewise.
	(FLAGS_VAR): Likewise.
	(AF_VAR_P): Likewise.
	(INTERNAL (REENTRANT_NAME)): Call __nss_hostname_digits_dots ()
	instead of including digits_dots.c.
Diffstat (limited to 'nss/getXXbyYY_r.c')
-rw-r--r--nss/getXXbyYY_r.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index b988711cff..71fc0c23dd 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,97,98,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1996,97,98,99,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -87,11 +87,23 @@
 #ifdef NEED_H_ERRNO
 # define H_ERRNO_PARM , int *h_errnop
 # define H_ERRNO_VAR , h_errnop
+# define H_ERRNO_VAR_P h_errnop
 #else
 # define H_ERRNO_PARM
 # define H_ERRNO_VAR
+# define H_ERRNO_VAR_P NULL
 #endif
 
+#ifndef HAVE_TYPE
+# define TYPE_VAR_P NULL
+# define FLAGS_VAR 0
+#endif
+
+#ifdef HAVE_AF
+# define AF_VAR_P &af
+#else
+# define AF_VAR_P NULL
+#endif
 
 /* Type of the lookup function we need here.  */
 typedef enum nss_status (*lookup_function) (ADD_PARAMS, LOOKUP_TYPE *, char *,
@@ -123,19 +135,16 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
 #endif
 
 #ifdef HANDLE_DIGITS_DOTS
-  /* We have to test for the use of IPv6 which can only be done by
-     examining `_res'.  */
-  if ((_res.options & RES_INIT) == 0 && __res_ninit (&_res) == -1)
+  switch (__nss_hostname_digits_dots (name, resbuf, &buffer, NULL,
+				      buflen, result, &status,
+				      TYPE_VAR_P, FLAGS_VAR, AF_VAR_P,
+				      H_ERRNO_VAR_P))
     {
-      *h_errnop = NETDB_INTERNAL;
-      *result = NULL;
+    case -1:
       return errno;
+    case 1:
+      goto done;
     }
-# define resbuf (*resbuf)
-# define result *result
-# include "digits_dots.c"
-# undef resbuf
-# undef result
 #endif
 
 #ifdef USE_NSCD