From 3cc3ef96d6c060e9d45b43f5482dc4e03945b30e Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 22 Aug 2012 13:31:12 -0700 Subject: BZ#13696: Add --disable-nscd configure option. --- nss/nss_db/db-init.c | 4 ++++ nss/nss_files/files-init.c | 6 +++++- nss/nsswitch.c | 10 +++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'nss') diff --git a/nss/nss_db/db-init.c b/nss/nss_db/db-init.c index d23e8f81d6..26508c2ca9 100644 --- a/nss/nss_db/db-init.c +++ b/nss/nss_db/db-init.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#ifdef USE_NSCD + #include #include #include @@ -51,3 +53,5 @@ _nss_db_init (void (*cb) (size_t, struct traced_file *)) strcpy (serv_traced_file.file.fname, _PATH_VARDB "services.db"); cb (servdb, &serv_traced_file.file); } + +#endif diff --git a/nss/nss_files/files-init.c b/nss/nss_files/files-init.c index 18757cb25b..d58bd82239 100644 --- a/nss/nss_files/files-init.c +++ b/nss/nss_files/files-init.c @@ -1,5 +1,5 @@ /* Initialization in nss_files module. - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#ifdef USE_NSCD + #include @@ -55,3 +57,5 @@ _nss_files_init (void (*cb) (size_t, struct traced_file *)) cb (netgrdb, &netgr_traced_file.file); } + +#endif diff --git a/nss/nsswitch.c b/nss/nsswitch.c index a2628c747c..750cd02ab0 100644 --- a/nss/nsswitch.c +++ b/nss/nsswitch.c @@ -92,10 +92,12 @@ static name_database *service_table; static name_database_entry *defconfig_entries; +#ifdef USE_NSCD /* Nonzero if this is the nscd process. */ static bool is_nscd; /* The callback passed to the init functions when nscd is used. */ static void (*nscd_init_cb) (size_t, struct traced_file *); +#endif /* -1 == database not found @@ -358,6 +360,7 @@ nss_load_library (service_user *ni) ni->library->lib_handle = (void *) -1l; __set_errno (saved_errno); } +# ifdef USE_NSCD else if (is_nscd) { /* Call the init function when nscd is used. */ @@ -377,12 +380,13 @@ nss_load_library (service_user *ni) if (ifct != NULL) { void (*cb) (size_t, struct traced_file *) = nscd_init_cb; -# ifdef PTR_DEMANGLE +# ifdef PTR_DEMANGLE PTR_DEMANGLE (cb); -# endif +# endif ifct (cb); } } +# endif } return 0; @@ -808,7 +812,7 @@ nss_new_service (name_database *database, const char *name) } -#ifdef SHARED +#if defined SHARED && defined USE_NSCD /* Load all libraries for the service. */ static void nss_load_all_libraries (const char *service, const char *def) -- cgit 1.4.1