AW: [Bug: Busybox 1.22.1] false return 0 instead of 1 with '--help' switch.

Alive4ever alive4ever at live.com
Mon Sep 1 09:22:16 UTC 2014


Simply put that false is never designed to return true. Otherwise, it's possible for false to imitate true behavior by alias true='busybox false --help'.

On September 1, 2014 3:48:40 PM GMT+07:00, Laurent Bercot <ska-dietlibc at skarnet.org> wrote:
>On 01/09/2014 09:20, dietmar.schindler at manroland-web.com wrote:
>> That does not follow.
>http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html#tag_17_04
>>  talks in the OPTIONS section about "arbitrary options that the
>implementation may provide as an extension"
>>  (as --help is) and that "utility options [...] modify the actions of
>the utility".
>>  (Also, it says: «When this section is listed as "None.", it means
>that the implementation need not support
>>  any options.» That doesn't mean "may not".)
>> The EXIT STATUS section also talks about "implementations with
>extensions", thus it seems evident to me
>>  that extensions may modify the exit status as part of their actions.
>
>I disagree with your interpretation. Modifying the actions of the
>utility does not mean modifying its
>exit code. I see nothing in EXIT STATUS that says that extensions are
>allowed to modify the exit status
>- on the contrary, POSIX insists on "maximum portability".
>
>Think about false. An implementation that returns 1 no matter what
>arguments it is given is
>conforming, so false --help is expected to return 1 by implementations
>that do not understand
>the --help option. An implementation that understands --help and
>returns 0 exhibits a
>different behaviour from a conforming implementation, and directly
>contradicts the EXIT STATUS
>section of the "false" page:
>
>    The false utility shall always exit with a value other than zero.
>
>Note the "always", which is not necessary, but serves to drive the
>point home.
>  I maintain that false is NEVER allowed to return 0, --help or not.
>
>-- 
>  Laurent
>
>_______________________________________________
>busybox mailing list
>busybox at busybox.net
>http://lists.busybox.net/mailman/listinfo/busybox



More information about the busybox mailing list