libsparse: Don't spam errors in sparse_file_import_auto.
This function is intended for use on sparse or non-sparse files. But when used on non-sparse files, it unintentionally reports errors when trying to detect if the file is sparse or not. Since the behavior is the same whether or not the detection fails, this patch disables verbose errors during the import. Verbose errors are turned on if a resparse is needed. Bug: 210846593 Test: fastboot flashall Change-Id: I8404ca7a67adc7fba8a3ac7b4ffa18abfbcafa9d
This commit is contained in:
parent
d17cefe7e4
commit
a7fd7b1689
1 changed files with 4 additions and 1 deletions
|
@ -670,7 +670,7 @@ struct sparse_file* sparse_file_import_auto(int fd, bool crc, bool verbose) {
|
|||
int64_t len;
|
||||
int ret;
|
||||
|
||||
s = sparse_file_import(fd, verbose, crc);
|
||||
s = sparse_file_import(fd, false, crc);
|
||||
if (s) {
|
||||
return s;
|
||||
}
|
||||
|
@ -686,6 +686,9 @@ struct sparse_file* sparse_file_import_auto(int fd, bool crc, bool verbose) {
|
|||
if (!s) {
|
||||
return nullptr;
|
||||
}
|
||||
if (verbose) {
|
||||
sparse_file_verbose(s);
|
||||
}
|
||||
|
||||
ret = sparse_file_read_normal(s, fd);
|
||||
if (ret < 0) {
|
||||
|
|
Loading…
Reference in a new issue