about summary refs log tree commit diff
path: root/nscd/nscd_helper.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2017-10-10 14:09:02 +0200
committerAndreas Schwab <schwab@suse.de>2017-10-11 15:51:52 +0200
commit2faa42daa886cc176dfc10fef2308c9191a6ec7f (patch)
tree3d40397552004382b7da9af9da37692657fc7dec /nscd/nscd_helper.c
parentd8425e116cdd954fea0c04c0f406179b5daebbb3 (diff)
downloadglibc-2faa42daa886cc176dfc10fef2308c9191a6ec7f.tar.gz
glibc-2faa42daa886cc176dfc10fef2308c9191a6ec7f.tar.xz
glibc-2faa42daa886cc176dfc10fef2308c9191a6ec7f.zip
nscd: remove reference to libnsl
This removes the dependency on libnsl from nscd.  It only used __nis_hash,
build its own copy under the name __nscd_hash.
Diffstat (limited to 'nscd/nscd_helper.c')
-rw-r--r--nscd/nscd_helper.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c
index 56e6d1421f..a42a4a7da5 100644
--- a/nscd/nscd_helper.c
+++ b/nscd/nscd_helper.c
@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <stdint.h>
 #include <sys/mman.h>
+#include <sys/param.h>
 #include <sys/poll.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
@@ -34,10 +35,10 @@
 #include <sys/uio.h>
 #include <sys/un.h>
 #include <not-cancel.h>
-#include <nis/rpcsvc/nis.h>
 #include <kernel-features.h>
 
 #include "nscd-client.h"
+#include "nscd_hash.h"
 
 
 /* Extra time we wait if the socket is still receiving data.  This
@@ -443,12 +444,6 @@ __nscd_get_map_ref (request_type type, const char *name,
 #define MINIMUM_HASHENTRY_SIZE \
   (offsetof (struct hashentry, dellist) + sizeof (int32_t))
 
-/* __nis_hash is defined in nis_hash.c which is included both libnsl
-   and libc.  Since the one in libnsl is exported and the one in libc
-   is hidden, __nis_hash is marked as hidden where it is referenced,
-   not where it is defined.  */
-extern __typeof (__nis_hash) __nis_hash attribute_hidden;
-
 /* Don't return const struct datahead *, as eventhough the record
    is normally constant, it can change arbitrarily during nscd
    garbage collection.  */
@@ -456,7 +451,7 @@ struct datahead *
 __nscd_cache_search (request_type type, const char *key, size_t keylen,
 		     const struct mapped_database *mapped, size_t datalen)
 {
-  unsigned long int hash = __nis_hash (key, keylen) % mapped->head->module;
+  unsigned long int hash = __nscd_hash (key, keylen) % mapped->head->module;
   size_t datasize = mapped->datasize;
 
   ref_t trail = mapped->head->array[hash];