From 6675b19146f30d626c5adf4c59e0626a2dc2afd0 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 18 Jan 2003 10:42:51 +0000 Subject: Update. * nis/nss_nis/nis-hosts.c: Make _nss_nis_endhostent an alias of _nss_nis_sethostent. Work around the different prototypes. * nis/nss_nis/nis-grp.c: Make _nss_nis_endgrent an alias of _nss_nis_setgrent. Work around the different prototypes. * nis/nss_nis/nis-ethers.c (internal_nis_endetherent): New function. Split out from _nss_nis_endetherent. (internal_nis_setetherent): Use internal_nis_endetherent instead of duplicating the code. * nis/nss_nis/nis-alias.c: Make _nss_nss_nis_endaliasent an alias of _nss_nis_setaliasent. * nis/nss_nis/nis-service.c (internal_nis_setservent): Reuse internal_nis_endservent code, don't duplicate it. --- nis/nss_nis/nis-hosts.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'nis/nss_nis/nis-hosts.c') diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c index 9b0332939c..9e59f59bdd 100644 --- a/nis/nss_nis/nis-hosts.c +++ b/nis/nss_nis/nis-hosts.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996,1997,1998,1999,2000,2002 Free Software Foundation, Inc. +/* Copyright (C) 1996-2000, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1996. @@ -19,7 +19,11 @@ #include #include +/* The following is an ugly trick to avoid a prototype declaration for + _nss_nis_endgrent. */ +#define _nss_nis_endhostent _nss_nis_endhostent_XXX #include +#undef _nss_nis_endhostent #include #include #include @@ -115,24 +119,10 @@ _nss_nis_sethostent (int stayopen) return NSS_STATUS_SUCCESS; } - -enum nss_status -_nss_nis_endhostent (void) -{ - __libc_lock_lock (lock); - - new_start = 1; - if (oldkey != NULL) - { - free (oldkey); - oldkey = NULL; - oldkeylen = 0; - } - - __libc_lock_unlock (lock); - - return NSS_STATUS_SUCCESS; -} +/* Make _nss_nis_endhostent an alias of _nss_nis_sethostent. We do this + even though the prototypes don't match. The argument of sethostent + is used so this makes no difference. */ +strong_alias (_nss_nis_sethostent, _nss_nis_endhostent) /* The calling function always need to get a lock first. */ static enum nss_status -- cgit 1.4.1