Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tar: make error reporting more robust and use correct errno #2101

Merged
merged 1 commit into from Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions tar/read.c
Expand Up @@ -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)));
Comment on lines +375 to +376

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes have mixed whitespace. Someone should probably replace the new added spaces with tabs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this follows FreeBSD style(9): tabs are 8, 2nd level indent is 4 spaces.
https://man.freebsd.org/cgi/man.cgi?query=style&sektion=9

if (!bsdtar->verbose)
fprintf(stderr, "\n");
bsdtar->return_value = 1;
Expand Down