From aaffc07346c5e95f5c2db2ba6b2bde9898ea4498 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 9 Dec 2007 15:35:42 -0600 Subject: Changeset 186 assumed that toys.exitval defaults to 0. Actually change the default and have [p]error_exit() always return nonzero anyway. --- lib/lib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/lib.c b/lib/lib.c index 2fd7fb8e..389adcdc 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -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 -- cgit v1.2.3