Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libarchive: backport "make error reporting more robust and use correc…
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 6110e9c82d8ba830c3440f36b990483ceaaea52c Mon Sep 17 00:00:00 2001 | ||
From: Ed Maste <emaste@freebsd.org> | ||
Date: Fri, 29 Mar 2024 18:02:06 -0400 | ||
Subject: [PATCH] tar: make error reporting more robust and use correct errno | ||
(#2101) | ||
|
||
As discussed in #1609. | ||
--- | ||
tar/read.c | 5 +++-- | ||
1 file changed, 3 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/tar/read.c b/tar/read.c | ||
index af3d3f423daff024791465bb9976a9b9a74b91ad..a7f14a07bb35602256b732cf3de96892e4280523 100644 | ||
--- a/tar/read.c | ||
+++ b/tar/read.c | ||
@@ -371,8 +371,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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters