From 662a267c9b52f256b027d0f176a846b1d973ab99 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 2 Jan 2013 02:00:35 -0600 Subject: Have error_msg() and friends set TT.exitval to 1 if it's still 0, clean out other places that were setting it that no longer need to. --- lib/lib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/lib.c b/lib/lib.c index 5b591d44..a21f6024 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -26,6 +26,7 @@ void verror_msg(char *msg, int err, va_list va) else s+=2; if (err) fprintf(stderr, s, strerror(err)); putc('\n', stderr); + if (!toys.exitval) toys.exitval++; } void error_msg(char *msg, ...) @@ -61,7 +62,6 @@ void error_exit(char *msg, ...) verror_msg(msg, 0, va); va_end(va); - if (!toys.exitval) toys.exitval++; if (toys.rebound) longjmp(*toys.rebound, 1); else exit(toys.exitval); } @@ -76,7 +76,6 @@ void perror_exit(char *msg, ...) verror_msg(msg, errno, va); va_end(va); - if (!toys.exitval) toys.exitval++; if (toys.rebound) longjmp(*toys.rebound, 1); else exit(toys.exitval); } -- cgit v1.2.3