Switch over to the google3 unix_file File*.
I also moved macros.h to base/macros.h to ease google3 porting, at
the expense of a larger than necessary change. (I learned my lesson,
though, and didn't make the equivalent base/logging.h change.)
I'm not sure whether we want to keep the unix_file MappedFile given
our existing MemMap, but it's easier to bring it over and then remove
it (and possibly revert the removal) than to bring it over later.
Change-Id: Id50a66faa5ab17b9bc936cc9043dbc26f791f0ca
diff --git a/src/zip_archive.cc b/src/zip_archive.cc
index 18a2f30..c9e9c0a 100644
--- a/src/zip_archive.cc
+++ b/src/zip_archive.cc
@@ -23,6 +23,7 @@
#include <sys/types.h>
#include <unistd.h>
+#include "base/unix_file/fd_file.h"
#include "UniquePtr.h"
namespace art {
@@ -243,13 +244,13 @@
uint32_t length = GetUncompressedLength();
int result = TEMP_FAILURE_RETRY(ftruncate(file.Fd(), length));
if (result == -1) {
- PLOG(WARNING) << "Zip: failed to ftruncate " << file.name() << " to length " << length;
+ PLOG(WARNING) << "Zip: failed to ftruncate " << file.GetPath() << " to length " << length;
return false;
}
UniquePtr<MemMap> map(MemMap::MapFile(length, PROT_READ | PROT_WRITE, MAP_SHARED, file.Fd(), 0));
if (map.get() == NULL) {
- LOG(WARNING) << "Zip: failed to mmap space for " << file.name();
+ LOG(WARNING) << "Zip: failed to mmap space for " << file.GetPath();
return false;
}