Mercurial > hg > toybox
diff lib/lib.c @ 780:6cc69be43c42
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.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 02 Jan 2013 02:00:35 -0600 |
parents | f169d9708518 |
children | 126cd3b8015c |
line wrap: on
line diff
--- a/lib/lib.c Mon Dec 31 14:38:13 2012 -0600 +++ b/lib/lib.c Wed Jan 02 02:00:35 2013 -0600 @@ -26,6 +26,7 @@ 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 @@ 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 @@ verror_msg(msg, errno, va); va_end(va); - if (!toys.exitval) toys.exitval++; if (toys.rebound) longjmp(*toys.rebound, 1); else exit(toys.exitval); }