| Index: runtime/bin/file_android.cc
|
| diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
|
| index ea512ad6593bdd514cfcb59e192e3cbb9c534eca..afe09669b9afce2d091c9518520c05aa5ecc496e 100644
|
| --- a/runtime/bin/file_android.cc
|
| +++ b/runtime/bin/file_android.cc
|
| @@ -7,14 +7,14 @@
|
|
|
| #include "bin/file.h"
|
|
|
| -#include <errno.h> // NOLINT
|
| -#include <fcntl.h> // NOLINT
|
| -#include <libgen.h> // NOLINT
|
| -#include <sys/mman.h> // NOLINT
|
| +#include <errno.h> // NOLINT
|
| +#include <fcntl.h> // NOLINT
|
| +#include <libgen.h> // NOLINT
|
| +#include <sys/mman.h> // NOLINT
|
| #include <sys/sendfile.h> // NOLINT
|
| -#include <sys/stat.h> // NOLINT
|
| -#include <sys/types.h> // NOLINT
|
| -#include <unistd.h> // NOLINT
|
| +#include <sys/stat.h> // NOLINT
|
| +#include <sys/types.h> // NOLINT
|
| +#include <unistd.h> // NOLINT
|
|
|
| #include "bin/builtin.h"
|
| #include "bin/log.h"
|
| @@ -27,8 +27,8 @@ namespace bin {
|
|
|
| class FileHandle {
|
| public:
|
| - explicit FileHandle(int fd) : fd_(fd) { }
|
| - ~FileHandle() { }
|
| + explicit FileHandle(int fd) : fd_(fd) {}
|
| + ~FileHandle() {}
|
| int fd() const { return fd_; }
|
| void set_fd(int fd) { fd_ = fd; }
|
|
|
| @@ -91,8 +91,7 @@ void* File::Map(MapType type, int64_t position, int64_t length) {
|
| default:
|
| return NULL;
|
| }
|
| - void* addr = mmap(NULL, length, prot, MAP_PRIVATE,
|
| - handle_->fd(), position);
|
| + void* addr = mmap(NULL, length, prot, MAP_PRIVATE, handle_->fd(), position);
|
| if (addr == MAP_FAILED) {
|
| return NULL;
|
| }
|
| @@ -320,8 +319,7 @@ bool File::Copy(const char* old_path, const char* new_path) {
|
| int result = 1;
|
| while (result > 0) {
|
| // Loop to ensure we copy everything, and not only up to 2GB.
|
| - result = NO_RETRY_EXPECTED(
|
| - sendfile(new_fd, old_fd, &offset, kMaxUint32));
|
| + result = NO_RETRY_EXPECTED(sendfile(new_fd, old_fd, &offset, kMaxUint32));
|
| }
|
| // From sendfile man pages:
|
| // Applications may wish to fall back to read(2)/write(2) in the case
|
| @@ -329,8 +327,8 @@ bool File::Copy(const char* old_path, const char* new_path) {
|
| if ((result < 0) && ((errno == EINVAL) || (errno == ENOSYS))) {
|
| const intptr_t kBufferSize = 8 * KB;
|
| uint8_t buffer[kBufferSize];
|
| - while ((result = TEMP_FAILURE_RETRY(
|
| - read(old_fd, buffer, kBufferSize))) > 0) {
|
| + while ((result = TEMP_FAILURE_RETRY(read(old_fd, buffer, kBufferSize))) >
|
| + 0) {
|
| int wrote = TEMP_FAILURE_RETRY(write(new_fd, buffer, result));
|
| if (wrote != result) {
|
| result = -1;
|
| @@ -506,9 +504,9 @@ File::Identical File::AreIdentical(const char* file_1, const char* file_2) {
|
| return File::kError;
|
| }
|
| return ((file_1_info.st_ino == file_2_info.st_ino) &&
|
| - (file_1_info.st_dev == file_2_info.st_dev)) ?
|
| - File::kIdentical :
|
| - File::kDifferent;
|
| + (file_1_info.st_dev == file_2_info.st_dev))
|
| + ? File::kIdentical
|
| + : File::kDifferent;
|
| }
|
|
|
| } // namespace bin
|
|
|