Merge "libziparchive: fix mac os breakage" am: 390f3b364c
am: 7cfe1d69b0
Change-Id: I0f1367d9fad529c3a65d7d3e6dc65343c4826889
This commit is contained in:
commit
cdbadafb4a
3 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
return pwrite(fd, buf, nbytes, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int ftruncate64(int fd, off64_t length) {
|
||||||
|
return ftruncate(fd, length);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __APPLE__ */
|
#endif /* __APPLE__ */
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "android-base/logging.h"
|
#include "android-base/logging.h"
|
||||||
|
#include "utils/Compat.h"
|
||||||
#include "utils/Log.h"
|
#include "utils/Log.h"
|
||||||
|
|
||||||
#include "entry_name_utils-inl.h"
|
#include "entry_name_utils-inl.h"
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,7 @@ TEST_F(zipwriter, TruncateFileAfterBackup) {
|
||||||
ASSERT_EQ(0, writer.WriteBytes(data.data(), data.size()));
|
ASSERT_EQ(0, writer.WriteBytes(data.data(), data.size()));
|
||||||
ASSERT_EQ(0, writer.FinishEntry());
|
ASSERT_EQ(0, writer.FinishEntry());
|
||||||
|
|
||||||
off64_t before_len = ftello64(file_);
|
off_t before_len = ftello(file_);
|
||||||
|
|
||||||
ZipWriter::FileEntry entry;
|
ZipWriter::FileEntry entry;
|
||||||
ASSERT_EQ(0, writer.GetLastEntry(&entry));
|
ASSERT_EQ(0, writer.GetLastEntry(&entry));
|
||||||
|
|
@ -385,7 +385,7 @@ TEST_F(zipwriter, TruncateFileAfterBackup) {
|
||||||
|
|
||||||
ASSERT_EQ(0, writer.Finish());
|
ASSERT_EQ(0, writer.Finish());
|
||||||
|
|
||||||
off64_t after_len = ftello64(file_);
|
off_t after_len = ftello(file_);
|
||||||
|
|
||||||
ASSERT_GT(before_len, after_len);
|
ASSERT_GT(before_len, after_len);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue