diff options
| author | Adam Lesinski <adamlesinski@google.com> | 2017-03-23 21:05:03 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-03-23 21:05:03 +0000 |
| commit | 7cfe1d69b0538aa2ee712e73798913afb37f1c91 (patch) | |
| tree | 39636830bb1ffb6e5434b8026cee24d811b65428 | |
| parent | e1d2e3436e0f0301f7acba9971f760fefc9036ae (diff) | |
| parent | 390f3b364caf7de728c4719432a1875f14c32455 (diff) | |
| download | system_core-7cfe1d69b0538aa2ee712e73798913afb37f1c91.tar.gz system_core-7cfe1d69b0538aa2ee712e73798913afb37f1c91.tar.bz2 system_core-7cfe1d69b0538aa2ee712e73798913afb37f1c91.zip | |
Merge "libziparchive: fix mac os breakage"
am: 390f3b364c
Change-Id: Ib7e882634636f74092487766f4abc8d969b0468a
| -rw-r--r-- | libutils/include/utils/Compat.h | 4 | ||||
| -rw-r--r-- | libziparchive/zip_writer.cc | 1 | ||||
| -rw-r--r-- | libziparchive/zip_writer_test.cc | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/libutils/include/utils/Compat.h b/libutils/include/utils/Compat.h index 2709e3b32..dee577e36 100644 --- a/libutils/include/utils/Compat.h +++ b/libutils/include/utils/Compat.h @@ -37,6 +37,10 @@ static inline ssize_t pwrite64(int fd, const void* buf, size_t nbytes, off64_t o return pwrite(fd, buf, nbytes, offset); } +static inline int ftruncate64(int fd, off64_t length) { + return ftruncate(fd, length); +} + #endif /* __APPLE__ */ #if defined(_WIN32) diff --git a/libziparchive/zip_writer.cc b/libziparchive/zip_writer.cc index ddd4dd5b6..760052886 100644 --- a/libziparchive/zip_writer.cc +++ b/libziparchive/zip_writer.cc @@ -25,6 +25,7 @@ #include <vector> #include "android-base/logging.h" +#include "utils/Compat.h" #include "utils/Log.h" #include "entry_name_utils-inl.h" diff --git a/libziparchive/zip_writer_test.cc b/libziparchive/zip_writer_test.cc index 259bcff54..30f49503d 100644 --- a/libziparchive/zip_writer_test.cc +++ b/libziparchive/zip_writer_test.cc @@ -377,7 +377,7 @@ TEST_F(zipwriter, TruncateFileAfterBackup) { ASSERT_EQ(0, writer.WriteBytes(data.data(), data.size())); ASSERT_EQ(0, writer.FinishEntry()); - off64_t before_len = ftello64(file_); + off_t before_len = ftello(file_); ZipWriter::FileEntry entry; ASSERT_EQ(0, writer.GetLastEntry(&entry)); @@ -385,7 +385,7 @@ TEST_F(zipwriter, TruncateFileAfterBackup) { ASSERT_EQ(0, writer.Finish()); - off64_t after_len = ftello64(file_); + off_t after_len = ftello(file_); ASSERT_GT(before_len, after_len); } |
