summaryrefslogtreecommitdiff
path: root/cat
diff options
context:
space:
mode:
authorMike Kazantsev <mk.fraggod@gmail.com>2014-04-09 01:24:59 +0600
committerfraggod@sacrilege <mk.fraggod@gmail.com>2014-04-09 03:54:58 +0600
commitbc851b10c5faa2b2390b144a9a54e9827cc99b78 (patch)
treefe148cd415e7d858594a94afbd111e082386eac3 /cat
parent969b872849b1c4d7fe179ef6c442850e876aeeb6 (diff)
downloadlibarchive-bc851b10c5faa2b2390b144a9a54e9827cc99b78.tar.gz
Exit with error status from bsdcat if any errors occurred.
Diffstat (limited to 'cat')
-rw-r--r--cat/bsdcat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cat/bsdcat.c b/cat/bsdcat.c
index e5e50e43..3ffd99ab 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);
}