From 56552e4257910954051f3ff02c0ee2609c7ca688 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 29 Jan 1997 03:50:12 +0000 Subject: update from main archive 970128 1997-01-29 04:30 Ulrich Drepper * sunrpc/Makefile: Don't generate headers derived from .x files when crosscompiling. 1997-01-28 10:51 Richard Henderson * 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 * elf/Makefile (CFLAGS-dl-load.c): Use += to not override the definition. 1997-01-28 20:13 Fila Kolodny * config.make.in (malloc): Remove. --- nss/nsswitch.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'nss/nsswitch.c') 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 , 1996. @@ -27,6 +27,7 @@ #include #include #include +#include #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. */ -- cgit v1.2.3