[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] maint: correct comments in test scripts
From: |
Ben Pfaff |
Subject: |
Re: [PATCH] maint: correct comments in test scripts |
Date: |
Fri, 20 Nov 2009 10:07:23 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Jim Meyering <address@hidden> writes:
> Ben Pfaff wrote:
>> Jim Meyering <address@hidden> writes:
>>
>>> I'm encountering a lot of exit(0)/exit(1) uses that
>>> trigger this new "syntax-check" rule, so I've taken
>>> the time to automate most of the clean-up process.
>>
>> This replaces exit(0) by exit(EXIT_SUCCESS), which makes sense
>> because POSIX says that EXIT_SUCCESS is defined as 0. But does
>> it always make sense to replace exit(1) by exit(EXIT_FAILURE)?
>> POSIX does not say that EXIT_FAILURE is always 1, but it does say
>> that some utilities are supposed to exit with exit status 1 in
>> some cases (e.g. "grep" when no lines are selected), so wouldn't
>> this lead to a POSIX violation in the most general case?
>
> Yes. That is why tools like sort define
>
> SORT_OUT_OF_ORDER = 1,
>
> and use that where appropriate.
OK. I should have looked at what coreutils actually does,
instead of guessing.
--
Ben Pfaff
http://benpfaff.org