From b70d19e75e55b925faf5a5e45878fc389b7e3ca4 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 26 Oct 2018 21:27:38 -0700 Subject: [PATCH] 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 --- libziparchive/zip_archive_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libziparchive/zip_archive_test.cc b/libziparchive/zip_archive_test.cc index af9f4c8be..0ea7d5d00 100644 --- a/libziparchive/zip_archive_test.cc +++ b/libziparchive/zip_archive_test.cc @@ -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 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(data_size + kATxtContents.size()), - lseek64(tmp_file.fd, 0, SEEK_END)); + lseek(tmp_file.fd, 0, SEEK_END)); } #if !defined(_WIN32)