From: Tobias Stoeckmann Date: Wed, 18 Mar 2026 14:53:41 +0000 (+0100) Subject: read_disk: Set correct match error codes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ef8b42aa95f32e1fb4a88da2a39daa2ea6a9979;p=thirdparty%2Flibarchive.git read_disk: Set correct match error codes The errno value is not correct here. If the error string of a failed match is printed, use also its error code. Signed-off-by: Tobias Stoeckmann --- diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index a7176bdd9..a12c21134 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -920,7 +920,7 @@ next_entry(struct archive_read_disk *a, struct tree *t, if (a->matching) { r = archive_match_path_excluded(a->matching, entry); if (r < 0) { - archive_set_error(&(a->archive), errno, + archive_set_error(&(a->archive), archive_errno(a->matching), "%s", archive_error_string(a->matching)); return (r); } @@ -1034,7 +1034,7 @@ next_entry(struct archive_read_disk *a, struct tree *t, if (a->matching) { r = archive_match_time_excluded(a->matching, entry); if (r < 0) { - archive_set_error(&(a->archive), errno, + archive_set_error(&(a->archive), archive_errno(a->matching), "%s", archive_error_string(a->matching)); return (r); } @@ -1060,7 +1060,7 @@ next_entry(struct archive_read_disk *a, struct tree *t, if (a->matching) { r = archive_match_owner_excluded(a->matching, entry); if (r < 0) { - archive_set_error(&(a->archive), errno, + archive_set_error(&(a->archive), archive_errno(a->matching), "%s", archive_error_string(a->matching)); return (r); } diff --git a/libarchive/archive_read_disk_windows.c b/libarchive/archive_read_disk_windows.c index 0e890497a..ac0117962 100644 --- a/libarchive/archive_read_disk_windows.c +++ b/libarchive/archive_read_disk_windows.c @@ -946,7 +946,7 @@ next_entry(struct archive_read_disk *a, struct tree *t, if (a->matching) { r = archive_match_path_excluded(a->matching, entry); if (r < 0) { - archive_set_error(&(a->archive), errno, + archive_set_error(&(a->archive), archive_errno(a->matching), "%s", archive_error_string(a->matching)); return (r); } @@ -1018,7 +1018,7 @@ next_entry(struct archive_read_disk *a, struct tree *t, if (a->matching) { r = archive_match_time_excluded(a->matching, entry); if (r < 0) { - archive_set_error(&(a->archive), errno, + archive_set_error(&(a->archive), archive_errno(a->matching), "%s", archive_error_string(a->matching)); return (r); } @@ -1044,7 +1044,7 @@ next_entry(struct archive_read_disk *a, struct tree *t, if (a->matching) { r = archive_match_owner_excluded(a->matching, entry); if (r < 0) { - archive_set_error(&(a->archive), errno, + archive_set_error(&(a->archive), archive_errno(a->matching), "%s", archive_error_string(a->matching)); return (r); }