OSDN Git Service

* mkgroup.c (enum_local_groups): Return failure if looking for a single
authorcorinna <corinna>
Mon, 18 Aug 2008 08:58:21 +0000 (08:58 +0000)
committercorinna <corinna>
Mon, 18 Aug 2008 08:58:21 +0000 (08:58 +0000)
group succeeded.  Add comment.

winsup/utils/ChangeLog
winsup/utils/mkgroup.c

index d38ec43..6978f95 100644 (file)
@@ -1,5 +1,10 @@
 2008-08-18  Corinna Vinschen  <corinna@vinschen.de>
 
+       * mkgroup.c (enum_local_groups): Return failure if looking for a single
+       group succeeded.  Add comment.
+
+2008-08-18  Corinna Vinschen  <corinna@vinschen.de>
+
        * mkgroup.c (main): Keep correctly track of optional arguments.
        * mkpasswd.c (main): Ditto.
 
index e2d73aa..3034e45 100644 (file)
@@ -454,7 +454,10 @@ skip_group:
     }
   while (rc == ERROR_MORE_DATA);
 
-  return 0;
+  /* Return -1 if the single group we're looking for has been found here to
+     avoid calling enum_groups for the same group, thus avoiding a spurious
+     error message "group name could not be found" in enum_groups. */
+  return disp_groupname && entriesread ? -1 : 0;
 }
 
 static void