[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] yes.c: do not use exit after error
From: |
Eric Blake |
Subject: |
Re: [PATCH] yes.c: do not use exit after error |
Date: |
Wed, 01 Jun 2011 08:09:15 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
On 05/27/2011 01:25 AM, Marek Polacek wrote:
> 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().
>
> --- coreutils/src/yes.c.mp 2011-05-27 09:09:56.320233888 +0200
> +++ coreutils/src/yes.c 2011-05-27 09:10:29.590237031 +0200
> @@ -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"));
Thanks; pushed.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH] yes.c: do not use exit after error,
Eric Blake <=