]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Exit with error status from bsdcat if any errors occurred.
authorMike Kazantsev <mk.fraggod@gmail.com>
Tue, 8 Apr 2014 19:24:59 +0000 (01:24 +0600)
committerfraggod@sacrilege <mk.fraggod@gmail.com>
Tue, 8 Apr 2014 21:54:58 +0000 (03:54 +0600)
cat/bsdcat.c

index e5e50e438feed38c153e83a59015859cec86c7fa..3ffd99ab58d69442123b3be71a61678067840244 100644 (file)
@@ -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);
 }