]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nss: Fix build error with --disable-nscd
authorCooper Qu <cooper.qu@linux.alibaba.com>
Tue, 13 Jul 2021 12:50:40 +0000 (20:50 +0800)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 14 Jul 2021 08:17:49 +0000 (10:17 +0200)
The error is as follows:
nss_module.c: In function 'module_load_nss_files':
nss_module.c:117:7: error: 'is_nscd' undeclared (first use in this function)
  117 |   if (is_nscd)
      |       ^~~~~~~
nss_module.c:117:7: note: each undeclared identifier is reported only once for each function it appears in
nss_module.c:119:51: error: 'nscd_init_cb' undeclared (first use in this function); did you mean 'nscd_init'?
  119 |       void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
      |                                                   ^~~~~~~~~~~~
      |                                                   nscd_init

nss/nss_module.c

index 7b42c585a460d35264200e18abcf2b80f39c71bb..7ea5ad98879515a546433d2de6256967f1238c99 100644 (file)
@@ -114,14 +114,16 @@ static const function_name nss_function_name_array[] =
 static bool
 module_load_nss_files (struct nss_module *module)
 {
+#ifdef USE_NSCD
   if (is_nscd)
     {
       void (*cb) (size_t, struct traced_file *) = nscd_init_cb;
-#  ifdef PTR_DEMANGLE
+# ifdef PTR_DEMANGLE
       PTR_DEMANGLE (cb);
-#  endif
+# endif
       _nss_files_init (cb);
     }
+#endif
 
   /* Initialize the function pointers, following the double-checked
      locking idiom.  */