If append_archive fails while writing an archive header, output the error

message from the archive being written (not the message from the archive
being read, where no error has occurred).

MFC after:	3 days
This commit is contained in:
Colin Percival 2007-01-05 16:20:21 +00:00
parent 9043d2778b
commit 161b2956bb

View File

@ -488,7 +488,7 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, const char *filename)
/* XXX handle/report errors XXX */
if (archive_write_header(a, in_entry)) {
bsdtar_warnc(bsdtar, 0, "%s",
archive_error_string(ina));
archive_error_string(a));
bsdtar->return_value = 1;
return (-1);
}