summaryrefslogtreecommitdiff
path: root/src/groups.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-01-28 00:08:32 +0100
committerJim Meyering <meyering@redhat.com>2008-02-14 11:31:57 +0100
commitcc8b73b1d9cb63c89a76db8ece8a699fb98fff1a (patch)
tree4dd2caba8f28bf2016bcd662654e90ae44240ee5 /src/groups.c
parent167b8025aca487de001da2448c1aebc2747bc1d3 (diff)
downloadcoreutils-cc8b73b1d9cb63c89a76db8ece8a699fb98fff1a.tar.gz
groups: don't test printf and putchar calls for failure
They are unnecessary, since we use gnulib's closeout module. * src/group-list.c (print_group): Remove explicit error tests. * src/groups.c (main): Likewise. (write_error): Remove function.
Diffstat (limited to 'src/groups.c')
-rw-r--r--src/groups.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/groups.c b/src/groups.c
index 8a4673ced..baac7b931 100644
--- a/src/groups.c
+++ b/src/groups.c
@@ -65,13 +65,6 @@ the current process (which is different if the groups database has changed).\n")
exit (status);
}
-static void
-write_error (void)
-{
- error (0, errno, _("write error"));
-}
-
-
int
main (int argc, char **argv)
{
@@ -111,11 +104,7 @@ main (int argc, char **argv)
if (!print_group_list (NULL, ruid, rgid, egid, true))
ok = false;
- if (EOF == putchar ('\n'))
- {
- write_error ();
- ok = false;
- }
+ putchar ('\n');
}
else
{
@@ -128,18 +117,10 @@ main (int argc, char **argv)
ruid = pwd->pw_uid;
rgid = egid = pwd->pw_gid;
- if (printf ("%s : ", argv[optind]) < 0)
- {
- write_error ();
- ok = false;
- }
+ printf ("%s : ", argv[optind]);
if (!print_group_list (argv[optind++], ruid, rgid, egid, true))
ok = false;
- if (EOF == putchar ('\n'))
- {
- write_error ();
- ok = false;
- }
+ putchar ('\n');
}
}