1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Merge r1052,r1055 from libarchive.googlecode.com:

Clear the error flag on entry to a few more API functions.
This commit is contained in:
Tim Kientzle 2009-04-27 18:33:08 +00:00
parent 01a94543e9
commit 7ad21ca8c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191578
4 changed files with 5 additions and 0 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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));

View File

@ -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);