Merge "Add verbose param to sparse_file_import_auto"

This commit is contained in:
Mohamad Ayyash 2015-04-01 17:34:56 +00:00 committed by Gerrit Code Review
commit 6900d34ed8
4 changed files with 6 additions and 5 deletions

View file

@ -538,7 +538,7 @@ void queue_info_dump(void)
static struct sparse_file **load_sparse_files(int fd, int max_size) 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) { if (!s) {
die("cannot sparse read file\n"); die("cannot sparse read file\n");
} }

View file

@ -82,7 +82,7 @@ int main(int argc, char *argv[])
exit(-1); exit(-1);
} }
sparse_output = sparse_file_import_auto(output, true); sparse_output = sparse_file_import_auto(output, true, true);
if (!sparse_output) { if (!sparse_output) {
fprintf(stderr, "Couldn't import output file\n"); fprintf(stderr, "Couldn't import output file\n");
exit(-1); exit(-1);

View file

@ -234,6 +234,7 @@ struct sparse_file *sparse_file_import(int fd, bool verbose, bool crc);
* *
* @fd - file descriptor to read from * @fd - file descriptor to read from
* @crc - verify the crc of a file in the Android sparse file format * @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. * 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 * 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. * 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 /** sparse_file_resparse - rechunk an existing sparse file into smaller files
* *

View file

@ -472,13 +472,13 @@ struct sparse_file *sparse_file_import(int fd, bool verbose, bool crc)
return s; 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; struct sparse_file *s;
int64_t len; int64_t len;
int ret; int ret;
s = sparse_file_import(fd, true, crc); s = sparse_file_import(fd, verbose, crc);
if (s) { if (s) {
return s; return s;
} }