From ed2ced8ae324a8a89a76ff3fc3971226b0107d3e Mon Sep 17 00:00:00 2001
From: Ulrich Drepper <drepper@redhat.com>
Date: Wed, 10 Nov 2004 07:54:40 +0000
Subject: Update.

2004-11-10  Jakub Jelinek  <jakub@redhat.com>

	* Makefile (tests): Add tst-exit3.
	* tst-exit3.c: New test.
---
 nscd/nscd_getai.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

(limited to 'nscd/nscd_getai.c')

diff --git a/nscd/nscd_getai.c b/nscd/nscd_getai.c
index 390b981f99..f0b2082baa 100644
--- a/nscd/nscd_getai.c
+++ b/nscd/nscd_getai.c
@@ -33,15 +33,8 @@
 extern int __nss_not_use_nscd_hosts;
 
 
-libc_locked_map_ptr (map_handle);
-/* Note that we only free the structure if necessary.  The memory
-   mapping is not removed since it is not visible to the malloc
-   handling.  */
-libc_freeres_fn (ai_map_free)
-{
-  if (map_handle.mapped != NO_MAPPING)
-    free (map_handle.mapped);
-}
+/* We use the mapping from nscd_gethst.  */
+libc_locked_map_ptr (extern, __hst_map_handle);
 
 
 int
@@ -53,7 +46,8 @@ __nscd_getai (const char *key, struct nscd_ai_result **result, int *h_errnop)
   /* If the mapping is available, try to search there instead of
      communicating with the nscd.  */
   struct mapped_database *mapped;
-  mapped = __nscd_get_map_ref (GETFDHST, "hosts", &map_handle, &gc_cycle);
+  mapped = __nscd_get_map_ref (GETFDHST, "hosts", &__hst_map_handle,
+			       &gc_cycle);
 
  retry:;
   const ai_response_header *ai_resp = NULL;
-- 
cgit v1.2.1