Change lseek to lseek64

Using lseek on 64-bit offset parameter caused failure
to write persistent data in crypto footer.

Changed calls to use lseek64 instead.

Change-Id: I4e4c397a6d36201b8b08be3017e17c9fac3b34e4
This commit is contained in:
Björn Landström 2015-01-20 12:43:56 +01:00 committed by Henrik Baard
parent f3b2637e06
commit 96dbee7bd6

View file

@ -867,13 +867,13 @@ static int save_persistent_data(void)
}
/* Write the new copy first, if successful, then erase the old copy */
if (lseek(fd, write_offset, SEEK_SET) < 0) {
if (lseek64(fd, write_offset, SEEK_SET) < 0) {
SLOGE("Cannot seek to write persistent data");
goto err2;
}
if (unix_write(fd, persist_data, crypt_ftr.persist_data_size) ==
(int) crypt_ftr.persist_data_size) {
if (lseek(fd, erase_offset, SEEK_SET) < 0) {
if (lseek64(fd, erase_offset, SEEK_SET) < 0) {
SLOGE("Cannot seek to erase previous persistent data");
goto err2;
}