libziparchive: use lseek directly.

The Mac doesn't have lseek64, and this code is built with
_FILE_OFFSET_BITS=64 anyway.

Bug: N/A
Test: ran tests
Change-Id: Ibda49c44ecfbe21b304e163e48f7ea42d97e38a7
This commit is contained in:
Elliott Hughes 2018-10-26 21:27:38 -07:00
parent 787de64fad
commit b70d19e75e

View file

@ -348,7 +348,7 @@ TEST(ziparchive, EntryLargerThan32K) {
// Read the file back to a buffer and make sure the contents are
// the same as the memory buffer we extracted directly to.
std::vector<uint8_t> file_contents(kAbUncompressedSize);
ASSERT_EQ(0, lseek64(tmp_output_file.fd, 0, SEEK_SET));
ASSERT_EQ(0, lseek(tmp_output_file.fd, 0, SEEK_SET));
ASSERT_TRUE(android::base::ReadFully(tmp_output_file.fd, &file_contents[0], file_contents.size()));
ASSERT_EQ(file_contents, buffer);
@ -392,7 +392,7 @@ TEST(ziparchive, ExtractToFile) {
// Assert that the first 8 bytes of the file haven't been clobbered.
uint8_t read_buffer[data_size];
ASSERT_EQ(0, lseek64(tmp_file.fd, 0, SEEK_SET));
ASSERT_EQ(0, lseek(tmp_file.fd, 0, SEEK_SET));
ASSERT_TRUE(android::base::ReadFully(tmp_file.fd, read_buffer, data_size));
ASSERT_EQ(0, memcmp(read_buffer, data, data_size));
@ -404,7 +404,7 @@ TEST(ziparchive, ExtractToFile) {
// Assert that the total length of the file is sane
ASSERT_EQ(static_cast<ssize_t>(data_size + kATxtContents.size()),
lseek64(tmp_file.fd, 0, SEEK_END));
lseek(tmp_file.fd, 0, SEEK_END));
}
#if !defined(_WIN32)