summary refs log tree commit diff
path: root/nis/nss_nis/nis-grp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-18 10:42:51 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-18 10:42:51 +0000
commit6675b19146f30d626c5adf4c59e0626a2dc2afd0 (patch)
treebc472f018cc789c4fff52a51c62e428b4f0eba19 /nis/nss_nis/nis-grp.c
parent039c1b75276118560dae730b033261a1ae8df7fa (diff)
downloadglibc-6675b19146f30d626c5adf4c59e0626a2dc2afd0.tar.gz
glibc-6675b19146f30d626c5adf4c59e0626a2dc2afd0.tar.xz
glibc-6675b19146f30d626c5adf4c59e0626a2dc2afd0.zip
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.
Diffstat (limited to 'nis/nss_nis/nis-grp.c')
-rw-r--r--nis/nss_nis/nis-grp.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/nis/nss_nis/nis-grp.c b/nis/nss_nis/nis-grp.c
index 68db76636b..e000e6a825 100644
--- a/nis/nss_nis/nis-grp.c
+++ b/nis/nss_nis/nis-grp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1999, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
 
@@ -18,7 +18,11 @@
    02111-1307 USA.  */
 
 #include <nss.h>
+/* The following is an ugly trick to avoid a prototype declaration for
+   _nss_nis_endgrent.  */
+#define _nss_nis_endgrent _nss_nis_endgrent_XXX
 #include <grp.h>
+#undef _nss_nis_endgrent
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
@@ -58,24 +62,10 @@ _nss_nis_setgrent (int stayopen)
 
   return NSS_STATUS_SUCCESS;
 }
-
-enum nss_status
-_nss_nis_endgrent (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_endgrent an alias of _nss_nis_setgrent.  We do this
+   even though the prototypes don't match.  The argument of setgrent
+   is used so this makes no difference.  */
+strong_alias (_nss_nis_setgrent, _nss_nis_endgrent)
 
 static enum nss_status
 internal_nis_getgrent_r (struct group *grp, char *buffer, size_t buflen,