From: Tim Kientzle Date: Sun, 21 Mar 2010 16:30:45 +0000 (-0400) Subject: Change raw_read_data_skip into a no-op. Remove the archive_read_consume_all function X-Git-Tag: v3.0.0a~1143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eeba48629e8325b391d6c98a9a2dcbe6ccc5702;p=thirdparty%2Flibarchive.git Change raw_read_data_skip into a no-op. Remove the archive_read_consume_all function that wasn't used anywhere else. SVN-Revision: 2049 --- diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index 992545f58..8667dde01 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -1197,23 +1197,6 @@ __archive_read_filter_consume(struct archive_read_filter * filter, return (ARCHIVE_FATAL); } -int64_t -__archive_read_consume_all(struct archive_read *a) -{ - int64_t total_bytes_skipped = 0; - off_t bytes_skipped; - int64_t request = 1024 * 1024 * 1024UL; /* Skip 1 GB at a time. */ - - for (;;) { - bytes_skipped = advance_file_pointer(a->filter, request); - if (bytes_skipped < 0) - return (ARCHIVE_FATAL); - total_bytes_skipped += bytes_skipped; - if (bytes_skipped < request) - return (total_bytes_skipped); - } -} - /* * Advance the file pointer by the amount requested. * Returns the amount actually advanced, which may be less than the diff --git a/libarchive/archive_read_private.h b/libarchive/archive_read_private.h index 7b0090972..8ecc3ecf7 100644 --- a/libarchive/archive_read_private.h +++ b/libarchive/archive_read_private.h @@ -210,6 +210,5 @@ const void *__archive_read_filter_ahead(struct archive_read_filter *, size_t, ssize_t *); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); -int64_t __archive_read_consume_all(struct archive_read *); int __archive_read_program(struct archive_read_filter *, const char *); #endif diff --git a/libarchive/archive_read_support_format_raw.c b/libarchive/archive_read_support_format_raw.c index bf4c0055b..3cbb8f5d9 100644 --- a/libarchive/archive_read_support_format_raw.c +++ b/libarchive/archive_read_support_format_raw.c @@ -168,16 +168,7 @@ archive_read_format_raw_read_data(struct archive_read *a, static int archive_read_format_raw_read_data_skip(struct archive_read *a) { - int64_t skipped; - struct raw_info *info; - - info = (struct raw_info *)(a->format->data); - if (info->end_of_file) - return (ARCHIVE_EOF); - info->end_of_file = 1; - skipped = __archive_read_consume_all(a); - if (skipped < 0) - return ((int)skipped); + (void)a; /* UNUSED */ return (ARCHIVE_OK); }