Re: [PATCH nft] tests: run-tests.sh: ensure non-zero exit when $failed != 0

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

 



Hi,

On Wed, Oct 20, 2021 at 02:44:09PM +0200, Štěpán Němec wrote:
> POSIX [1] does not specify the behavior of `exit' with arguments
> outside the 0-255 range, but what generally (bash, dash, zsh, OpenBSD
> ksh, busybox) seems to happen is the shell exiting with status & 255
> [2], which results in zero exit for certain non-zero arguments.

Standards aside, failed=256 is an actual bug:

| % bash -c "exit 255"; echo $?
| 255
| % bash -c "exit 256"; echo $?
| 0
| % bash -c "exit 257"; echo $?
| 1

Thanks, Phil



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux