hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 7073df590dd57ec89312ffb9425aff22956bf78f
parent 53b8cfc00a6d1ce8d5c8ee9c51c84a036349235b
Author: the lemons <citrons@mondecitronne.com>
Date:   Thu, 12 May 2022 10:38:59 -0500

fmt::fatal - exit with 255

fmt::fatal returning 255 will more reliably indicate a generic error
condition.

there are cases where the required exit status of a program is not
binary between a generic error condition and success. among POSIX
utilities, 0 always indicates success; however, 1 does not always
indicate a generic error. values >127 are always specified to be a
generic error except in the commands command, env, nice, nohup, time,
and xargs.

Signed-off-by: Re Elbertson <citrons@mondecitronne.com>

Diffstat:
Mfmt/fmt.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fmt/fmt.ha b/fmt/fmt.ha @@ -61,7 +61,7 @@ export fn bsprintf(buf: []u8, fmt: str, args: field...) str = { // feed, then exits the program with an error status. export @noreturn fn fatalf(fmt: str, args: field...) void = { fprintfln(os::stderr, fmt, args...)!; - os::exit(1); + os::exit(255); }; // Formats values for printing using the default format modifiers and writes @@ -69,7 +69,7 @@ export @noreturn fn fatalf(fmt: str, args: field...) void = { // exits the program with an error status. export @noreturn fn fatal(args: formattable...) void = { fprintln(os::stderr, args...)!; - os::exit(1); + os::exit(255); }; // Formats text for printing and writes it to an [[io::handle]], followed by a