| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 7 | 7 |
| 8 #include "bin/file.h" | 8 #include "bin/file.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const int kBufferSize = 1024; | 58 const int kBufferSize = 1024; |
| 59 char error_message[kBufferSize]; | 59 char error_message[kBufferSize]; |
| 60 strerror_r(errno, error_message, kBufferSize); | 60 strerror_r(errno, error_message, kBufferSize); |
| 61 Log::PrintErr("%s\n", error_message); | 61 Log::PrintErr("%s\n", error_message); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 handle_->set_fd(kClosedFd); | 64 handle_->set_fd(kClosedFd); |
| 65 } | 65 } |
| 66 | 66 |
| 67 | 67 |
| 68 intptr_t File::GetFD() { |
| 69 return handle_->fd(); |
| 70 } |
| 71 |
| 72 |
| 68 bool File::IsClosed() { | 73 bool File::IsClosed() { |
| 69 return handle_->fd() == kClosedFd; | 74 return handle_->fd() == kClosedFd; |
| 70 } | 75 } |
| 71 | 76 |
| 72 | 77 |
| 73 int64_t File::Read(void* buffer, int64_t num_bytes) { | 78 int64_t File::Read(void* buffer, int64_t num_bytes) { |
| 74 ASSERT(handle_->fd() >= 0); | 79 ASSERT(handle_->fd() >= 0); |
| 75 return TEMP_FAILURE_RETRY(read(handle_->fd(), buffer, num_bytes)); | 80 return TEMP_FAILURE_RETRY(read(handle_->fd(), buffer, num_bytes)); |
| 76 } | 81 } |
| 77 | 82 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 return (file_1_info.st_ino == file_2_info.st_ino && | 427 return (file_1_info.st_ino == file_2_info.st_ino && |
| 423 file_1_info.st_dev == file_2_info.st_dev) ? | 428 file_1_info.st_dev == file_2_info.st_dev) ? |
| 424 File::kIdentical : | 429 File::kIdentical : |
| 425 File::kDifferent; | 430 File::kDifferent; |
| 426 } | 431 } |
| 427 | 432 |
| 428 } // namespace bin | 433 } // namespace bin |
| 429 } // namespace dart | 434 } // namespace dart |
| 430 | 435 |
| 431 #endif // defined(TARGET_OS_ANDROID) | 436 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |