Merge r1052,r1055 from libarchive.googlecode.com:
Clear the error flag on entry to a few more API functions.
This commit is contained in:
parent
01a94543e9
commit
7ad21ca8c3
@ -66,6 +66,7 @@ archive_read_open_fd(struct archive *a, int fd, size_t block_size)
|
||||
struct read_fd_data *mine;
|
||||
void *b;
|
||||
|
||||
archive_clear_error(a);
|
||||
if (fstat(fd, &st) != 0) {
|
||||
archive_set_error(a, errno, "Can't stat fd %d", fd);
|
||||
return (ARCHIVE_FATAL);
|
||||
|
@ -70,6 +70,7 @@ archive_read_open_FILE(struct archive *a, FILE *f)
|
||||
size_t block_size = 128 * 1024;
|
||||
void *b;
|
||||
|
||||
archive_clear_error(a);
|
||||
mine = (struct read_FILE_data *)malloc(sizeof(*mine));
|
||||
b = malloc(block_size);
|
||||
if (mine == NULL || b == NULL) {
|
||||
|
@ -84,6 +84,7 @@ archive_read_open_filename(struct archive *a, const char *filename,
|
||||
void *b;
|
||||
int fd;
|
||||
|
||||
archive_clear_error(a);
|
||||
if (filename == NULL || filename[0] == '\0')
|
||||
return (archive_read_open_fd(a, 0, block_size));
|
||||
|
||||
|
@ -100,6 +100,7 @@ archive_read_support_compression_xz(struct archive *_a)
|
||||
struct archive_read *a = (struct archive_read *)_a;
|
||||
struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
|
||||
|
||||
archive_clear_error(_a);
|
||||
if (bidder == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
|
||||
@ -123,6 +124,7 @@ archive_read_support_compression_lzma(struct archive *_a)
|
||||
struct archive_read *a = (struct archive_read *)_a;
|
||||
struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
|
||||
|
||||
archive_clear_error(_a);
|
||||
if (bidder == NULL)
|
||||
return (ARCHIVE_FATAL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user