From bc851b10c5faa2b2390b144a9a54e9827cc99b78 Mon Sep 17 00:00:00 2001 From: Mike Kazantsev Date: Wed, 9 Apr 2014 01:24:59 +0600 Subject: [PATCH] Exit with error status from bsdcat if any errors occurred. --- cat/bsdcat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cat/bsdcat.c b/cat/bsdcat.c index e5e50e438..3ffd99ab5 100644 --- a/cat/bsdcat.c +++ b/cat/bsdcat.c @@ -36,6 +36,7 @@ struct archive *a; struct archive_entry *ae; char *bsdcat_current_path; +int exit_status = 0; void @@ -69,6 +70,7 @@ bsdcat_print_error(void) { lafe_warnc(0, "%s: %s", bsdcat_current_path, archive_error_string(a)); + exit_status = 1; } void @@ -116,5 +118,5 @@ main(int argc, char **argv) bsdcat_next(); } - exit(0); + exit(exit_status); } -- 2.47.2