summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2007-04-07 05:56:40 +0000
committerkientzle <kientzle@FreeBSD.org>2007-04-07 05:56:40 +0000
commit1bfe8ebed6fe77c90cb82473026fd7587731a72e (patch)
tree82d061219137e30a1bede02dea1c446fd5b38ce5 /usr.bin/tar
parent495689c98f061c40d68ac25009a282e9c9090510 (diff)
downloadFreeBSD-src-1bfe8ebed6fe77c90cb82473026fd7587731a72e.zip
FreeBSD-src-1bfe8ebed6fe77c90cb82473026fd7587731a72e.tar.gz
Simplify the logic for handling header read
errors.
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/read.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/tar/read.c b/usr.bin/tar/read.c
index 1fec9ea..92e0d8e 100644
--- a/usr.bin/tar/read.c
+++ b/usr.bin/tar/read.c
@@ -122,19 +122,17 @@ read_archive(struct bsdtar *bsdtar, char mode)
r = archive_read_next_header(a, &entry);
if (r == ARCHIVE_EOF)
break;
- if (r == ARCHIVE_WARN)
+ if (r < ARCHIVE_OK)
bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
- if (r == ARCHIVE_FATAL) {
- bsdtar->return_value = 1;
- bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
- break;
- }
if (r == ARCHIVE_RETRY) {
/* Retryable error: try again */
- bsdtar_warnc(bsdtar, 0, "%s", archive_error_string(a));
bsdtar_warnc(bsdtar, 0, "Retrying...");
continue;
}
+ if (r != ARCHIVE_OK) {
+ bsdtar->return_value = 1;
+ break;
+ }
/*
* Exclude entries that are too old.
OpenPOWER on IntegriCloud