bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] maint: correct comments in test scripts


From: Eric Blake
Subject: Re: [PATCH] maint: correct comments in test scripts
Date: Fri, 20 Nov 2009 19:31:17 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Ben Pfaff <blp <at> cs.stanford.edu> writes:

> 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?

Not an issue.  About the only other EXIT_FAILURE value out in the wild is -1 
(aka 255), but as 255 causes xargs to behave differently, it is just too broken 
to keep.  Therefore, since Mar 2007, gnulib's stdlib module explicitly 
redefines EXIT_FAILURE to 1 for those rare platforms (Tandem/NSK) that tried to 
be cute by using something that was not the traditional 1.

-- 
Eric Blake






reply via email to

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