[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/26] trivial: use exit(EXIT_SUC

From: Eric Blake
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/26] trivial: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Fri, 16 Sep 2016 10:39:21 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 09/16/2016 10:27 AM, Daniel P. Berrange wrote:
> On Fri, Sep 16, 2016 at 03:55:51PM +0200, Laurent Vivier wrote:
>> This series is the result of coccinelle patch
>> scripts/coccinelle/exit.cocci
>> provided by the first patch of the series.
>> It replaces exit(0) by exit(EXIT_SUCCESS)
>> and exit(1) by exit(EXIT_FAILURE).
> Some places use '_exit' and should have had the same
> change applied AFAICT.

And _Exit(), if we use it.

>> All other exit() are not modified as we don't want
>> to change the behavior.
> IMHO, modifying the other exit() calls is precisely
> what would make this series useful.
> eg there's a bunch of places which arbitrarily use
> '-1' instead of '1' as the value for no good reason.

What's more, exit(-1) is awful to use; it results in an exit status of
255 due to truncation on Linux; and further has weird effects on
xargs(1) (which special-cases a status of 255, differently than a status
of 1).

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]