From 80cc1f6864288f166b786a61ad57f12081114225 Mon Sep 17 00:00:00 2001 From: Mohamad Ayyash Date: Tue, 31 Mar 2015 12:09:29 -0700 Subject: [PATCH] Add verbose param to sparse_file_import_auto Change-Id: I0c5607f7aa5e964abc2031bbe71ff5c6e6ef56cc Signed-off-by: Mohamad Ayyash --- fastboot/fastboot.cpp | 2 +- libsparse/append2simg.c | 2 +- libsparse/include/sparse/sparse.h | 3 ++- libsparse/sparse_read.c | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 6dc7d345a..e139bcd25 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -538,7 +538,7 @@ void queue_info_dump(void) static struct sparse_file **load_sparse_files(int fd, int max_size) { - struct sparse_file* s = sparse_file_import_auto(fd, false); + struct sparse_file* s = sparse_file_import_auto(fd, false, true); if (!s) { die("cannot sparse read file\n"); } diff --git a/libsparse/append2simg.c b/libsparse/append2simg.c index 65e6cc29b..1cf827cd8 100644 --- a/libsparse/append2simg.c +++ b/libsparse/append2simg.c @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) exit(-1); } - sparse_output = sparse_file_import_auto(output, true); + sparse_output = sparse_file_import_auto(output, true, true); if (!sparse_output) { fprintf(stderr, "Couldn't import output file\n"); exit(-1); diff --git a/libsparse/include/sparse/sparse.h b/libsparse/include/sparse/sparse.h index 8b757d22a..42d4adb87 100644 --- a/libsparse/include/sparse/sparse.h +++ b/libsparse/include/sparse/sparse.h @@ -234,6 +234,7 @@ struct sparse_file *sparse_file_import(int fd, bool verbose, bool crc); * * @fd - file descriptor to read from * @crc - verify the crc of a file in the Android sparse file format + * @verbose - whether to use verbose logging * * Reads an existing sparse or normal file into a sparse file cookie. * Attempts to determine if the file is sparse or not by looking for the sparse @@ -243,7 +244,7 @@ struct sparse_file *sparse_file_import(int fd, bool verbose, bool crc); * * Returns a new sparse file cookie on success, NULL on error. */ -struct sparse_file *sparse_file_import_auto(int fd, bool crc); +struct sparse_file *sparse_file_import_auto(int fd, bool crc, bool verbose); /** sparse_file_resparse - rechunk an existing sparse file into smaller files * diff --git a/libsparse/sparse_read.c b/libsparse/sparse_read.c index 8e188e9a4..9b10293fe 100644 --- a/libsparse/sparse_read.c +++ b/libsparse/sparse_read.c @@ -472,13 +472,13 @@ struct sparse_file *sparse_file_import(int fd, bool verbose, bool crc) return s; } -struct sparse_file *sparse_file_import_auto(int fd, bool crc) +struct sparse_file *sparse_file_import_auto(int fd, bool crc, bool verbose) { struct sparse_file *s; int64_t len; int ret; - s = sparse_file_import(fd, true, crc); + s = sparse_file_import(fd, verbose, crc); if (s) { return s; }