Simplify the logic for handling header read

errors.
This commit is contained in:
Tim Kientzle 2007-04-07 05:56:40 +00:00
parent 94451fa8a0
commit c2c19b10c7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168454

View File

@ -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.