mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 01:01:06 +00:00
tar: make error reporting more robust and use correct errno
Apply upstream pull request 2101.
This commit is contained in:
parent
9eff58c6d5
commit
d68c68693e
|
@ -372,8 +372,9 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
|
|||
if (r != ARCHIVE_OK) {
|
||||
if (!bsdtar->verbose)
|
||||
safe_fprintf(stderr, "%s", archive_entry_pathname(entry));
|
||||
fprintf(stderr, ": %s: ", archive_error_string(a));
|
||||
fprintf(stderr, "%s", strerror(errno));
|
||||
safe_fprintf(stderr, ": %s: %s",
|
||||
archive_error_string(a),
|
||||
strerror(archive_errno(a)));
|
||||
if (!bsdtar->verbose)
|
||||
fprintf(stderr, "\n");
|
||||
bsdtar->return_value = 1;
|
||||
|
|
Loading…
Reference in a new issue