diff options
| author | Colin Percival <cperciva@FreeBSD.org> | 2007-04-16 04:04:50 +0000 |
|---|---|---|
| committer | Colin Percival <cperciva@FreeBSD.org> | 2007-04-16 04:04:50 +0000 |
| commit | 6fc0ea8474e616cacbc73576b315de3390b6b0f0 (patch) | |
| tree | cda739747030f2ad831dd044ecd406b516c18c7a /usr.bin | |
| parent | d302816a125d10cfcc1da40cf13535c2831affcf (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/tar/read.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.bin/tar/read.c b/usr.bin/tar/read.c index 65074871e6c3..2e44c9ee5195 100644 --- a/usr.bin/tar/read.c +++ b/usr.bin/tar/read.c @@ -223,11 +223,12 @@ read_archive(struct bsdtar *bsdtar, char mode) archive_entry_pathname(entry)); fflush(stderr); } - if (bsdtar->option_stdout) { - /* TODO: Catch/recover any errors here. */ - archive_read_data_into_fd(a, 1); - } else if (archive_read_extract(a, entry, - bsdtar->extract_flags)) { + if (bsdtar->option_stdout) + r = archive_read_data_into_fd(a, 1); + else + r = archive_read_extract(a, entry, + bsdtar->extract_flags); + if (r != ARCHIVE_OK) { if (!bsdtar->verbose) safe_fprintf(stderr, "%s", archive_entry_pathname(entry)); @@ -235,14 +236,12 @@ read_archive(struct bsdtar *bsdtar, char mode) archive_error_string(a)); if (!bsdtar->verbose) fprintf(stderr, "\n"); - /* - * TODO: Decide how to handle - * extraction error... <sigh> - */ bsdtar->return_value = 1; } if (bsdtar->verbose) fprintf(stderr, "\n"); + if (r == ARCHIVE_FATAL) + break; } } |
