aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2013-01-02 02:00:35 -0600
committerRob Landley <rob@landley.net>2013-01-02 02:00:35 -0600
commit662a267c9b52f256b027d0f176a846b1d973ab99 (patch)
tree1ff58749c737a283a199e1e567894fe16a9d0ce5 /lib/lib.c
parent090c5c607ec682e5cfc03bbc745cd1ed28d5d6ce (diff)
downloadtoybox-662a267c9b52f256b027d0f176a846b1d973ab99.tar.gz
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.
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c3
1 files changed, 1 insertions, 2 deletions
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);
}