This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.20-377-g66ce3cb


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  66ce3cb12f74d3dbd4018ce6498a36348acf7e83 (commit)
      from  d22ce01becae90db0c65c82fd2e1aa7898df7ce6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=66ce3cb12f74d3dbd4018ce6498a36348acf7e83

commit 66ce3cb12f74d3dbd4018ce6498a36348acf7e83
Author: Steve Ellcey <sellcey@mips.com>
Date:   Wed Dec 17 10:00:37 2014 -0800

    2014-12-17  Steve Ellcey  <sellcey@imgtec.com>
    
    	* inet/getnetgrent_r.c: Move while loop to be inside if statement.

diff --git a/ChangeLog b/ChangeLog
index 276e613..a7cb40e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-17  Steve Ellcey  <sellcey@imgtec.com>
+
+	* inet/getnetgrent_r.c: Move while loop to be inside if statement.
+
 2014-12-17  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
 	* stdio-common/bug-vfprintf-nargs.c (do_test):
diff --git a/inet/getnetgrent_r.c b/inet/getnetgrent_r.c
index e101537..1f12ce9 100644
--- a/inet/getnetgrent_r.c
+++ b/inet/getnetgrent_r.c
@@ -281,8 +281,8 @@ __internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
     {
 #ifdef USE_NSCD
       /* This bogus function pointer is a special marker left by
-         __nscd_setnetgrent to tell us to use the data it left
-         before considering any modules.  */
+	 __nscd_setnetgrent to tell us to use the data it left
+	 before considering any modules.  */
       if (datap->nip == (service_user *) -1l)
 	fct = nscd_getnetgrent;
       else
@@ -291,74 +291,73 @@ __internal_getnetgrent_r (char **hostp, char **userp, char **domainp,
 	  fct = __nss_lookup_function (datap->nip, "getnetgrent_r");
 	  no_more = fct == NULL;
 	}
-    }
-
-  while (! no_more)
-    {
-      status = DL_CALL_FCT (*fct, (datap, buffer, buflen, &errno));
 
-      if (status == NSS_STATUS_RETURN
-	  /* The service returned a NOTFOUND, but there are more groups that we
-	     need to resolve before we give up.  */
-	  || (status == NSS_STATUS_NOTFOUND && datap->needed_groups != NULL))
+      while (! no_more)
 	{
-	  /* This was the last one for this group.  Look at next group
-	     if available.  */
-	  int found = 0;
-	  while (datap->needed_groups != NULL && ! found)
+	  status = DL_CALL_FCT (*fct, (datap, buffer, buflen, &errno));
+
+	  if (status == NSS_STATUS_RETURN
+	      /* The service returned a NOTFOUND, but there are more groups that
+		 we need to resolve before we give up.  */
+	      || (status == NSS_STATUS_NOTFOUND && datap->needed_groups != NULL))
 	    {
-	      struct name_list *tmp = datap->needed_groups;
-	      datap->needed_groups = datap->needed_groups->next;
-	      tmp->next = datap->known_groups;
-	      datap->known_groups = tmp;
+	      /* This was the last one for this group.  Look at next group
+		 if available.  */
+	      int found = 0;
+	      while (datap->needed_groups != NULL && ! found)
+		{
+		  struct name_list *tmp = datap->needed_groups;
+		  datap->needed_groups = datap->needed_groups->next;
+		  tmp->next = datap->known_groups;
+		  datap->known_groups = tmp;
 
-	      found = __internal_setnetgrent_reuse (datap->known_groups->name,
-						    datap, errnop);
-	    }
+		  found = __internal_setnetgrent_reuse (datap->known_groups->name,
+							datap, errnop);
+		}
 
-	  if (found && datap->nip != NULL)
-	    {
-	      fct = __nss_lookup_function (datap->nip, "getnetgrent_r");
-	      if (fct != NULL)
-		continue;
+	      if (found && datap->nip != NULL)
+		{
+		  fct = __nss_lookup_function (datap->nip, "getnetgrent_r");
+		  if (fct != NULL)
+		    continue;
+		}
 	    }
-	}
-      else if (status == NSS_STATUS_SUCCESS && datap->type == group_val)
-	{
-	  /* The last entry was a name of another netgroup.  */
-	  struct name_list *namep;
-
-	  /* Ignore if we've seen the name before.  */
-	  for (namep = datap->known_groups; namep != NULL;
-	       namep = namep->next)
-	    if (strcmp (datap->val.group, namep->name) == 0)
-	      break;
-	  if (namep == NULL)
-	    for (namep = datap->needed_groups; namep != NULL;
-		 namep = namep->next)
-	      if (strcmp (datap->val.group, namep->name) == 0)
-		break;
-	  if (namep != NULL)
-	    /* Really ignore.  */
-	    continue;
-
-	  size_t group_len = strlen (datap->val.group) + 1;
-	  namep = (struct name_list *) malloc (sizeof (struct name_list)
-					       + group_len);
-	  if (namep == NULL)
-	    /* We are out of memory.  */
-	    status = NSS_STATUS_RETURN;
-	  else
+	  else if (status == NSS_STATUS_SUCCESS && datap->type == group_val)
 	    {
-	      namep->next = datap->needed_groups;
-	      memcpy (namep->name, datap->val.group, group_len);
-	      datap->needed_groups = namep;
-	      /* And get the next entry.  */
-	      continue;
+	      /* The last entry was a name of another netgroup.  */
+	      struct name_list *namep;
+
+	      /* Ignore if we've seen the name before.  */
+	      for (namep = datap->known_groups; namep != NULL;
+		   namep = namep->next)
+		if (strcmp (datap->val.group, namep->name) == 0)
+		  break;
+	      if (namep == NULL)
+		for (namep = datap->needed_groups; namep != NULL;
+		     namep = namep->next)
+		  if (strcmp (datap->val.group, namep->name) == 0)
+		    break;
+	      if (namep != NULL)
+		/* Really ignore.  */
+		continue;
+
+	      size_t group_len = strlen (datap->val.group) + 1;
+	      namep = (struct name_list *) malloc (sizeof (struct name_list)
+						  + group_len);
+	      if (namep == NULL)
+		/* We are out of memory.  */
+		status = NSS_STATUS_RETURN;
+	      else
+		{
+		  namep->next = datap->needed_groups;
+		  memcpy (namep->name, datap->val.group, group_len);
+		  datap->needed_groups = namep;
+		  /* And get the next entry.  */
+		  continue;
+		}
 	    }
+	  break;
 	}
-
-      break;
     }
 
   if (status == NSS_STATUS_SUCCESS)
@@ -382,7 +381,7 @@ __getnetgrent_r (char **hostp, char **userp, char **domainp,
   __libc_lock_lock (lock);
 
   status = __internal_getnetgrent_r (hostp, userp, domainp, &dataset,
-                                     buffer, buflen, &errno);
+				     buffer, buflen, &errno);
 
   __libc_lock_unlock (lock);
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog            |    4 ++
 inet/getnetgrent_r.c |  125 +++++++++++++++++++++++++-------------------------
 2 files changed, 66 insertions(+), 63 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]