mirror of
https://github.com/expo/bsdiff.git
synced 2026-11-14 17:49:03 -10:00
Merge "Fix A/B update fail for 32-bit devices"
am: 0474f1be45
Change-Id: I503cda9f3e4c0b034c22cdf7bb9c557bf52147f5
This commit is contained in:
commit
5902405547
3 files changed
+7
-5
No files matched your search
@@ -27,6 +27,9 @@
|
||||
# "bsdiff/...".
|
||||
'<(platform2_root)/../aosp/external',
|
||||
],
|
||||
'defines': [
|
||||
'_FILE_OFFSET_BITS=64',
|
||||
],
|
||||
},
|
||||
'targets': [
|
||||
# bsdiff static library
|
||||
|
||||
@@ -64,11 +64,7 @@ bool File::Seek(off_t pos) {
|
||||
errno = EBADF;
|
||||
return false;
|
||||
}
|
||||
// fseek() uses a long value for the offset which could be smaller than off_t.
|
||||
if (pos > std::numeric_limits<long>::max()) {
|
||||
errno = EOVERFLOW;
|
||||
return false;
|
||||
}
|
||||
|
||||
off_t newpos = lseek(fd_, pos, SEEK_SET);
|
||||
if (newpos < 0)
|
||||
return false;
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
|
||||
#include "bsdiff/common.h"
|
||||
|
||||
static_assert(sizeof(off_t) == sizeof(int64_t),
|
||||
"off_t must be a 64-bit number, use -D_FILE_OFFSET_BITS=64");
|
||||
|
||||
namespace bsdiff {
|
||||
|
||||
class BSDIFF_EXPORT FileInterface {
|
||||
|
||||
Reference in new issue
Block a user