]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 19 Jan 2003 19:22:02 +0000 (19:22 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 19 Jan 2003 19:22:02 +0000 (19:22 +0000)
2003-01-19  Ulrich Drepper  <drepper@redhat.com>

* nis/nss_nis/nis-spwd.c: Make _nss_nis_endspent an alias of
_nss_nis_setspent.  Work around the different prototypes.
* nis/nss_nis/nis-rpc.c (internal_nis_setrpcent): Use
internal_nis_endrpcent.
(internal_nis_endrpcent): Change return type to void.  Change callers.
* nis/nss_nis/nis-pwd.c: Make _nss_nis_endpwent an alias of
_nss_nis_setpwent.  Work around the different prototypes.
* nis/nss_nis/nis-proto.c (_nss_nis_endprotoent): Split out body
of the function to...
(internal_nis_endprotoent): ... here.  New function.
(internal_nis_setprotoent): Use internal_nis_endprotoent.
* nis/nss_nis/nis-network.c: Make _nss_nis_endnetent an alias of
_nss_nis_setnetent.  Work around the different prototypes.
* nis/nss_nis/nis-netgrp.c (_nss_nis_endnetgrent): Split out body
of the function to...
(internal_nis_endnetgrent): ... here.  New function.
(_nss_nis_setnetgrent): Use internal_nis_endnetgrent.

ChangeLog
nis/nss_nis/nis-grp.c
nis/nss_nis/nis-netgrp.c
nis/nss_nis/nis-network.c
nis/nss_nis/nis-proto.c
nis/nss_nis/nis-pwd.c
nis/nss_nis/nis-rpc.c
nis/nss_nis/nis-spwd.c

index 09656b3045ef618b9ec87cb9392300376107a4b2..d13d4376cb2b36ffeb81eb4224f6a7367d0b2876 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2003-01-19  Ulrich Drepper  <drepper@redhat.com>
+
+       * nis/nss_nis/nis-spwd.c: Make _nss_nis_endspent an alias of
+       _nss_nis_setspent.  Work around the different prototypes.
+       * nis/nss_nis/nis-rpc.c (internal_nis_setrpcent): Use
+       internal_nis_endrpcent.
+       (internal_nis_endrpcent): Change return type to void.  Change callers.
+       * nis/nss_nis/nis-pwd.c: Make _nss_nis_endpwent an alias of
+       _nss_nis_setpwent.  Work around the different prototypes.
+       * nis/nss_nis/nis-proto.c (_nss_nis_endprotoent): Split out body
+       of the function to...
+       (internal_nis_endprotoent): ... here.  New function.
+       (internal_nis_setprotoent): Use internal_nis_endprotoent.
+       * nis/nss_nis/nis-network.c: Make _nss_nis_endnetent an alias of
+       _nss_nis_setnetent.  Work around the different prototypes.
+       * nis/nss_nis/nis-netgrp.c (_nss_nis_endnetgrent): Split out body
+       of the function to...
+       (internal_nis_endnetgrent): ... here.  New function.
+       (_nss_nis_setnetgrent): Use internal_nis_endnetgrent.
+
 2003-01-19  Jim Meyering  <jim@meyering.net>
 
        * time/strftime.c: (widen): Merge nearly-identical definitions.
index e000e6a825482b71a18ae0fd464c930bd26d8697..c090a7726642367c8996a1b64c69921e98f804f2 100644 (file)
@@ -64,7 +64,7 @@ _nss_nis_setgrent (int stayopen)
 }
 /* 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.  */
+   is not used so this makes no difference.  */
 strong_alias (_nss_nis_setgrent, _nss_nis_endgrent)
 
 static enum nss_status
index c9b52428c362f213fa0ac46a965f1f4c5ba9540a..e9318d6e95e166668ff2aa9f826e34fdd82f130d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1999,2000,2002,2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
 
@@ -42,6 +42,19 @@ extern enum nss_status
 _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
                         char *buffer, size_t buflen, int *errnop);
 
+
+static void
+internal_nis_endnetgrent (void)
+{
+  if (data != NULL)
+    {
+      free (data);
+      data = NULL;
+      data_size = 0;
+      cursor = NULL;
+    }
+}
+
 enum nss_status
 _nss_nis_setnetgrent (const char *group, struct __netgrent *dummy)
 {
@@ -60,13 +73,7 @@ _nss_nis_setnetgrent (const char *group, struct __netgrent *dummy)
 
   __libc_lock_lock (lock);
 
-  if (data != NULL)
-    {
-      free (data);
-      data = NULL;
-      data_size = 0;
-      cursor = NULL;
-    }
+  internal_nis_endnetgrent ();
 
   group_len = strlen (group);
 
@@ -96,13 +103,7 @@ _nss_nis_endnetgrent (struct __netgrent *dummy)
 {
   __libc_lock_lock (lock);
 
-  if (data != NULL)
-    {
-      free (data);
-      data = NULL;
-      data_size = 0;
-      cursor = NULL;
-    }
+  internal_nis_endnetgrent ();
 
   __libc_lock_unlock (lock);
 
index 0e40b6f26c26cc5fd8ea0b444de6243c1f399189..2292aea2c03ecf7b510c7c7d6f314fff9c43016f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
    02111-1307 USA.  */
 
 #include <nss.h>
+/* The following is an ugly trick to avoid a prototype declaration for
+   _nss_nis_endgrent.  */
+#define _nss_nis_endnetent _nss_nis_endnetent_XXX
 #include <netdb.h>
+#undef _nss_nis_endnetent
 #include <ctype.h>
 #include <errno.h>
 #include <stdint.h>
@@ -59,24 +63,10 @@ _nss_nis_setnetent (int stayopen)
 
   return NSS_STATUS_SUCCESS;
 }
-
-enum nss_status
-_nss_nis_endnetent (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_endnetent an alias of _nss_nis_setnetent.  We do this
+   even though the prototypes don't match.  The argument of setnetent
+   is not used so this makes no difference.  */
+strong_alias (_nss_nis_setnetent, _nss_nis_endnetent)
 
 static enum nss_status
 internal_nis_getnetent_r (struct netent *net, char *buffer, size_t buflen,
index 00e86dfa6b5d950274c43d91d517d61af28e8b44..b8c234ed6ffe0f59e059de2222d5ba8db53d6740 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,2000,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998, 2000-2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
 
@@ -78,15 +78,9 @@ saveit (int instatus, char *inkey, int inkeylen, char *inval,
   return 0;
 }
 
-static enum nss_status
-internal_nis_setprotoent (void)
+static void
+internal_nis_endprotoent (void)
 {
-  char *domainname;
-  struct ypall_callback ypcb;
-  enum nss_status status;
-
-  yp_get_default_domain (&domainname);
-
   while (start != NULL)
     {
       if (start->val != NULL)
@@ -95,7 +89,18 @@ internal_nis_setprotoent (void)
       start = start->next;
       free (next);
     }
-  start = NULL;
+}
+
+static enum nss_status
+internal_nis_setprotoent (void)
+{
+  char *domainname;
+  struct ypall_callback ypcb;
+  enum nss_status status;
+
+  yp_get_default_domain (&domainname);
+
+  internal_nis_endprotoent ();
 
   ypcb.foreach = saveit;
   ypcb.data = NULL;
@@ -124,15 +129,7 @@ _nss_nis_endprotoent (void)
 {
   __libc_lock_lock (lock);
 
-  while (start != NULL)
-    {
-      if (start->val != NULL)
-        free (start->val);
-      next = start;
-      start = start->next;
-      free (next);
-    }
-  start = NULL;
+  internal_nis_endprotoent ();
   next = NULL;
 
   __libc_lock_unlock (lock);
index da5ffabff1645d7d48ebf3ac70bd5ccc3b15e2d1..0f56ced014b19d17ea23e69f84c54b6b79b0af14 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
    02111-1307 USA.  */
 
 #include <nss.h>
+/* The following is an ugly trick to avoid a prototype declaration for
+   _nss_nis_endpwent.  */
+#define _nss_nis_endpwent _nss_nis_endpwent_XXX
 #include <pwd.h>
+#undef _nss_nis_endpwent
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
@@ -58,24 +62,10 @@ _nss_nis_setpwent (int stayopen)
 
   return NSS_STATUS_SUCCESS;
 }
-
-enum nss_status
-_nss_nis_endpwent (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_endpwent an alias of _nss_nis_setpwent.  We do this
+   even though the prototypes don't match.  The argument of setpwent
+   is not used so this makes no difference.  */
+strong_alias (_nss_nis_setpwent, _nss_nis_endpwent)
 
 static enum nss_status
 internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
index 1f9e5b4600f48e2cadb9cfa264c405a0f006ea11..6e707b9d58cd28afe403cc683940c8922d5d30fb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998, 2000, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
 
@@ -86,6 +86,19 @@ saveit (int instatus, char *inkey, int inkeylen, char *inval,
   return 0;
 }
 
+static void
+internal_nis_endrpcent (intern_t *intern)
+{
+  while (intern->start != NULL)
+    {
+      if (intern->start->val != NULL)
+        free (intern->start->val);
+      intern->next = intern->start;
+      intern->start = intern->start->next;
+      free (intern->next);
+    }
+}
+
 static enum nss_status
 internal_nis_setrpcent (intern_t *intern)
 {
@@ -96,15 +109,7 @@ internal_nis_setrpcent (intern_t *intern)
   if (yp_get_default_domain (&domainname))
     return NSS_STATUS_UNAVAIL;
 
-  while (intern->start != NULL)
-    {
-      if (intern->start->val != NULL)
-        free (intern->start->val);
-      intern->next = intern->start;
-      intern->start = intern->start->next;
-      free (intern->next);
-    }
-  intern->start = NULL;
+  internal_nis_endrpcent (intern);
 
   ypcb.foreach = saveit;
   ypcb.data = (char *)intern;
@@ -128,34 +133,16 @@ _nss_nis_setrpcent (int stayopen)
   return status;
 }
 
-static enum nss_status
-internal_nis_endrpcent (intern_t *intern)
-{
-  while (intern->start != NULL)
-    {
-      if (intern->start->val != NULL)
-        free (intern->start->val);
-      intern->next = intern->start;
-      intern->start = intern->start->next;
-      free (intern->next);
-    }
-  intern->start = NULL;
-
-  return NSS_STATUS_SUCCESS;
-}
-
 enum nss_status
 _nss_nis_endrpcent (void)
 {
-  enum nss_status status;
-
   __libc_lock_lock (lock);
 
-  status = internal_nis_endrpcent (&intern);
+  internal_nis_endrpcent (&intern);
 
   __libc_lock_unlock (lock);
 
-  return status;
+  return NSS_STATUS_SUCCESS;
 }
 
 static enum nss_status
index c06e95457ef418fcdd053c27ced769a0997c15dc..99a9ed5f48baa121d2ecfb5e74c877004d3c3b3c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1996-1998, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
+/* The following is an ugly trick to avoid a prototype declaration for
+   _nss_nis_endspent.  */
+#define _nss_nis_endspent _nss_nis_endspent_XXX
 #include <shadow.h>
+#undef _nss_nis_endspent
 #include <bits/libc-lock.h>
 #include <rpcsvc/yp.h>
 #include <rpcsvc/ypclnt.h>
@@ -47,35 +51,18 @@ _nss_nis_setspent (int stayopen)
   __libc_lock_lock (lock);
 
   new_start = 1;
-  if (oldkey != NULL)
-    {
-      free (oldkey);
-      oldkey = NULL;
-      oldkeylen = 0;
-    }
-
-  __libc_lock_unlock (lock);
-
-  return NSS_STATUS_SUCCESS;
-}
-
-enum nss_status
-_nss_nis_endspent (void)
-{
-  __libc_lock_lock (lock);
-
-  new_start = 1;
-  if (oldkey != NULL)
-    {
-      free (oldkey);
-      oldkey = NULL;
-      oldkeylen = 0;
-    }
+  free (oldkey);
+  oldkey = NULL;
+  oldkeylen = 0;
 
   __libc_lock_unlock (lock);
 
   return NSS_STATUS_SUCCESS;
 }
+/* Make _nss_nis_endspent an alias of _nss_nis_setspent.  We do this
+   even though the prototypes don't match.  The argument of setspent
+   is not used so this makes no difference.  */
+strong_alias (_nss_nis_setspent, _nss_nis_endspent)
 
 static enum nss_status
 internal_nis_getspent_r (struct spwd *sp, char *buffer, size_t buflen,