aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2007-04-16 04:04:50 +0000
committerColin Percival <cperciva@FreeBSD.org>2007-04-16 04:04:50 +0000
commit6fc0ea8474e616cacbc73576b315de3390b6b0f0 (patch)
treecda739747030f2ad831dd044ecd406b516c18c7a /usr.bin
parentd302816a125d10cfcc1da40cf13535c2831affcf (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tar/read.c17
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;
}
}