about summary refs log tree commit diff
path: root/nss/nsswitch.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-01-29 03:50:12 +0000
committerUlrich Drepper <drepper@redhat.com>1997-01-29 03:50:12 +0000
commit56552e4257910954051f3ff02c0ee2609c7ca688 (patch)
tree6660d07114fd608b08bc49225d600ffb84027a57 /nss/nsswitch.c
parent831372e7c1bb907f9f2c3d78909b15717b8ac095 (diff)
downloadglibc-56552e4257910954051f3ff02c0ee2609c7ca688.tar.gz
glibc-56552e4257910954051f3ff02c0ee2609c7ca688.tar.xz
glibc-56552e4257910954051f3ff02c0ee2609c7ca688.zip
update from main archive 970128 cvs/libc-970129
1997-01-29 04:30  Ulrich Drepper  <drepper@cygnus.com>

	* sunrpc/Makefile: Don't generate headers derived from .x files when
	crosscompiling.

1997-01-28 10:51  Richard Henderson  <rth@tamu.edu>

	* Makefile: Generate gnu/lib-names.h in before-compile.
	* nss/nss.h (NSS_SHLIB_REVISION): Turn it into a const variable.
	* nss/nssswitch.c (__nss_shlib_revision): New variable.  Initialize
	to the revision found for LIBNSS_FILES_SO.
	(nss_initilized): Removed.  It was tested but never set.
	(nss_lookup_function): Don't treat NSS_SHLIB_REVISION as a literal.

	* shlib-versions: Tag all alpha-linux shlibs with a .1 "minor"
	not just libc.  Except instead of ld.so.1.1 use ld-linux.so.2.

	* sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S: Typo in ldgp.

1997-01-28 12:16  Andreas Jaeger  <aj@arthur.pfalz.de>

	* elf/Makefile (CFLAGS-dl-load.c): Use += to not
	override the definition.

1997-01-28 20:13  Fila Kolodny  <fila@ibi.com>

	* config.make.in (malloc): Remove.
Diffstat (limited to 'nss/nsswitch.c')
-rw-r--r--nss/nsswitch.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 1b061fa3cd..201a2bccfe 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <gnu/lib-names.h>
 
 #include "nsswitch.h"
 
@@ -63,8 +64,8 @@ static struct
 __libc_lock_define_initialized (static, lock)
 
 
-/* Nonzero if the sevices are already initialized.  */
-static int nss_initialized;
+/* String with revision number of the shared object files.  */
+const char *const __nss_shlib_revision = LIBNSS_FILES_SO + 15;
 
 
 /* The root of the whole data base.  */
@@ -88,7 +89,8 @@ __nss_database_lookup (const char *database, const char *alternate_name,
       return 0;
     }
 
-  if (nss_initialized == 0 && service_table == NULL)
+  /* Are we initialized yet?  */
+  if (service_table == NULL)
     /* Read config file.  */
     service_table = nss_parse_file (_PATH_NSSWITCH_CONF);
 
@@ -330,7 +332,7 @@ nss_lookup_function (service_user *ni, const char *fct_name)
 	    {
 	      /* Load the shared library.  */
 	      size_t shlen = (7 + strlen (ni->library->name) + 3
-			      + sizeof (NSS_SHLIB_REVISION));
+			      + strlen (NSS_SHLIB_REVISION) + 1);
 	      char shlib_name[shlen];
 
 	      void do_open (void)
@@ -340,9 +342,10 @@ nss_lookup_function (service_user *ni, const char *fct_name)
 		}
 
 	      /* Construct shared object name.  */
-	      __stpcpy (__stpcpy (__stpcpy (shlib_name, "libnss_"),
-				  ni->library->name),
-			".so" NSS_SHLIB_REVISION);
+	      __stpcpy (__stpcpy (__stpcpy (__stpcpy (shlib_name, "libnss_"),
+					    ni->library->name),
+				  ".so"),
+			NSS_SHLIB_REVISION);
 
 	      if (nss_dlerror_run (do_open) != 0)
 		/* Failed to load the library.  */