Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6900d34e authored by Mohamad Ayyash's avatar Mohamad Ayyash Committed by Gerrit Code Review
Browse files

Merge "Add verbose param to sparse_file_import_auto"

parents 0c266ef2 80cc1f68
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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");
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
+2 −1
Original line number Original line Diff line number Diff line
@@ -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
 *
 *
+2 −2
Original line number Original line Diff line number Diff line
@@ -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;
	}
	}