summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamad Ayyash2015-03-31 14:09:29 -0500
committerMohamad Ayyash2015-03-31 14:09:37 -0500
commit80cc1f6864288f166b786a61ad57f12081114225 (patch)
treeb1c21a62d3a0aa23c69d77318ffe24ffbad2ec5a /libsparse
parentb6f38def22add4b5d6878185d238f91659239161 (diff)
downloadplatform-system-core-80cc1f6864288f166b786a61ad57f12081114225.tar.gz
platform-system-core-80cc1f6864288f166b786a61ad57f12081114225.tar.xz
platform-system-core-80cc1f6864288f166b786a61ad57f12081114225.zip
Add verbose param to sparse_file_import_auto
Change-Id: I0c5607f7aa5e964abc2031bbe71ff5c6e6ef56cc Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
Diffstat (limited to 'libsparse')
-rw-r--r--libsparse/append2simg.c2
-rw-r--r--libsparse/include/sparse/sparse.h3
-rw-r--r--libsparse/sparse_read.c4
3 files changed, 5 insertions, 4 deletions
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[])
82 exit(-1); 82 exit(-1);
83 } 83 }
84 84
85 sparse_output = sparse_file_import_auto(output, true); 85 sparse_output = sparse_file_import_auto(output, true, true);
86 if (!sparse_output) { 86 if (!sparse_output) {
87 fprintf(stderr, "Couldn't import output file\n"); 87 fprintf(stderr, "Couldn't import output file\n");
88 exit(-1); 88 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);
234 * 234 *
235 * @fd - file descriptor to read from 235 * @fd - file descriptor to read from
236 * @crc - verify the crc of a file in the Android sparse file format 236 * @crc - verify the crc of a file in the Android sparse file format
237 * @verbose - whether to use verbose logging
237 * 238 *
238 * Reads an existing sparse or normal file into a sparse file cookie. 239 * Reads an existing sparse or normal file into a sparse file cookie.
239 * Attempts to determine if the file is sparse or not by looking for the sparse 240 * 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);
243 * 244 *
244 * Returns a new sparse file cookie on success, NULL on error. 245 * Returns a new sparse file cookie on success, NULL on error.
245 */ 246 */
246struct sparse_file *sparse_file_import_auto(int fd, bool crc); 247struct sparse_file *sparse_file_import_auto(int fd, bool crc, bool verbose);
247 248
248/** sparse_file_resparse - rechunk an existing sparse file into smaller files 249/** sparse_file_resparse - rechunk an existing sparse file into smaller files
249 * 250 *
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)
472 return s; 472 return s;
473} 473}
474 474
475struct sparse_file *sparse_file_import_auto(int fd, bool crc) 475struct sparse_file *sparse_file_import_auto(int fd, bool crc, bool verbose)
476{ 476{
477 struct sparse_file *s; 477 struct sparse_file *s;
478 int64_t len; 478 int64_t len;
479 int ret; 479 int ret;
480 480
481 s = sparse_file_import(fd, true, crc); 481 s = sparse_file_import(fd, verbose, crc);
482 if (s) { 482 if (s) {
483 return s; 483 return s;
484 } 484 }