diff options
author | Rob Landley <rob@landley.net> | 2007-12-09 15:35:42 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2007-12-09 15:35:42 -0600 |
commit | aaffc07346c5e95f5c2db2ba6b2bde9898ea4498 (patch) | |
tree | 992b261e82f8f9a8effc05e0eb4fe9fb7ebcbde2 | |
parent | ea6387aed235fd75c836138b4e0133918ee86820 (diff) | |
download | toybox-aaffc07346c5e95f5c2db2ba6b2bde9898ea4498.tar.gz |
Changeset 186 assumed that toys.exitval defaults to 0. Actually change the
default and have [p]error_exit() always return nonzero anyway.
-rw-r--r-- | lib/lib.c | 5 | ||||
-rw-r--r-- | main.c | 1 |
2 files changed, 2 insertions, 4 deletions
@@ -59,7 +59,7 @@ void error_exit(char *msg, ...) verror_msg(msg, 0, va); va_end(va); - exit(toys.exitval); + exit(!toys.exitval ? 1 : toys.exitval); } @@ -72,7 +72,7 @@ void perror_exit(char *msg, ...) verror_msg(msg, errno, va); va_end(va); - exit(toys.exitval); + exit(!toys.exitval ? 1 : toys.exitval); } // Die unless we can allocate memory. @@ -350,7 +350,6 @@ struct string_list *find_in_path(char *path, char *filename) free(cwd); return rlist; - } // Convert unsigned int to ascii, writing into supplied buffer. A truncated @@ -68,7 +68,6 @@ void toy_init(struct toy_list *which, char *argv[]) toys.which = which; toys.argv = argv; - toys.exitval = 1; if (NEED_OPTIONS && which->options) get_optflags(); else toys.optargs = argv+1; } |