From 0c36a942c9c4e2423a129c85f3c2016fe57fec05 Mon Sep 17 00:00:00 2001 From: Abhinav Aggarwal Date: Tue, 2 Jun 2020 13:47:35 +0100 Subject: Enable >= 2GiB file size support in backupToTar for 32 bit targets. backupToTar function used in fullbackup currently uses off_t to represent file sizes which overflows for files having size >= 2 GiB on 32 bit target architectures. This CL replaces off_t with off64_t to overcome this limitation. Fixes: 157633626 Test: atest libandroidfw_tests Test: Locally running a backup with a test app having a file of size 2GiB and verifying the size variable in backupToTar doesn't overflow on a 32 bit target. Change-Id: I404cced810f331ecb9327495ce1f092f1fa2d378 --- libs/androidfw/BackupHelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/androidfw/BackupHelpers.cpp') diff --git a/libs/androidfw/BackupHelpers.cpp b/libs/androidfw/BackupHelpers.cpp index 8bfe2b6a259a..e80e9486c8b2 100644 --- a/libs/androidfw/BackupHelpers.cpp +++ b/libs/androidfw/BackupHelpers.cpp @@ -479,7 +479,7 @@ void send_tarfile_chunk(BackupDataWriter* writer, const char* buffer, size_t siz } int write_tarfile(const String8& packageName, const String8& domain, - const String8& rootpath, const String8& filepath, off_t* outSize, + const String8& rootpath, const String8& filepath, off64_t* outSize, BackupDataWriter* writer) { // In the output stream everything is stored relative to the root -- cgit v1.2.3-59-g8ed1b