diff options
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_virtual.c')
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_virtual.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_virtual.c b/Utilities/cmlibarchive/libarchive/archive_virtual.c index 752dc17..0c4155f 100644 --- a/Utilities/cmlibarchive/libarchive/archive_virtual.c +++ b/Utilities/cmlibarchive/libarchive/archive_virtual.c @@ -67,8 +67,17 @@ archive_read_close(struct archive *a) } int +archive_write_fail(struct archive *a) +{ + a->state = ARCHIVE_STATE_FATAL; + return a->state; +} + +int archive_write_free(struct archive *a) { + if (a == NULL) + return (ARCHIVE_OK); return ((a->vtable->archive_free)(a)); } @@ -77,13 +86,15 @@ archive_write_free(struct archive *a) int archive_write_finish(struct archive *a) { - return ((a->vtable->archive_free)(a)); + return archive_write_free(a); } #endif int archive_read_free(struct archive *a) { + if (a == NULL) + return (ARCHIVE_OK); return ((a->vtable->archive_free)(a)); } @@ -92,7 +103,7 @@ archive_read_free(struct archive *a) int archive_read_finish(struct archive *a) { - return ((a->vtable->archive_free)(a)); + return archive_read_free(a); } #endif |