summaryrefslogtreecommitdiff
path: root/src/yes.c
diff options
context:
space:
mode:
authorMarek Polacek <mpolacek@redhat.com>2011-05-27 09:25:11 +0200
committerEric Blake <eblake@redhat.com>2011-06-01 08:05:29 -0600
commitcc8ee4d351028b0303ae9bad0103df6c2dde8cb6 (patch)
tree2e835868344813ffc4593930900904424c26eab3 /src/yes.c
parente7b4bf4b57efb699c87f03c1173d812ea34cb618 (diff)
downloadcoreutils-cc8ee4d351028b0303ae9bad0103df6c2dde8cb6.tar.xz
yes.c: do not use exit after error
I think it would be better to exit through the error() and not to call the exit() after the error(). This way we can get rid of one function call (and curly brackets). * src/yes.c (main): Exit through the error(), remove exit() call after error().
Diffstat (limited to 'src/yes.c')
-rw-r--r--src/yes.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/yes.c b/src/yes.c
index 25b1679a7..18b5c5342 100644
--- a/src/yes.c
+++ b/src/yes.c
@@ -84,9 +84,6 @@ main (int argc, char **argv)
for (i = optind; i < argc; i++)
if (fputs (argv[i], stdout) == EOF
|| putchar (i == argc - 1 ? '\n' : ' ') == EOF)
- {
- error (0, errno, _("standard output"));
- exit (EXIT_FAILURE);
- }
+ error (EXIT_FAILURE, errno, _("standard output"));
}
}