| Index: runtime/bin/file_linux.cc
|
| diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
|
| index 7a976070ea53355598818b4dfc565de8fc4ee0c1..70f7fcf16cbe6010465731e013e7a8191a1e27ab 100644
|
| --- a/runtime/bin/file_linux.cc
|
| +++ b/runtime/bin/file_linux.cc
|
| @@ -8,6 +8,7 @@
|
| #include <unistd.h>
|
| #include <libgen.h>
|
|
|
| +#include "bin/builtin.h"
|
| #include "bin/file.h"
|
|
|
| class FileHandle {
|
| @@ -36,7 +37,7 @@ File::~File() {
|
|
|
|
|
| void File::Close() {
|
| - assert(handle_->fd() >= 0);
|
| + ASSERT(handle_->fd() >= 0);
|
| int err = close(handle_->fd());
|
| if (err != 0) {
|
| const int kBufferSize = 1024;
|
| @@ -54,31 +55,31 @@ bool File::IsClosed() {
|
|
|
|
|
| int64_t File::Read(void* buffer, int64_t num_bytes) {
|
| - assert(handle_->fd() >= 0);
|
| + ASSERT(handle_->fd() >= 0);
|
| return read(handle_->fd(), buffer, num_bytes);
|
| }
|
|
|
|
|
| int64_t File::Write(const void* buffer, int64_t num_bytes) {
|
| - assert(handle_->fd() >= 0);
|
| + ASSERT(handle_->fd() >= 0);
|
| return write(handle_->fd(), buffer, num_bytes);
|
| }
|
|
|
|
|
| off_t File::Position() {
|
| - assert(handle_->fd() >= 0);
|
| + ASSERT(handle_->fd() >= 0);
|
| return lseek(handle_->fd(), 0, SEEK_CUR);
|
| }
|
|
|
|
|
| void File::Flush() {
|
| - assert(handle_->fd() >= 0);
|
| + ASSERT(handle_->fd() >= 0);
|
| fsync(handle_->fd());
|
| }
|
|
|
|
|
| off_t File::Length() {
|
| - assert(handle_->fd() >= 0);
|
| + ASSERT(handle_->fd() >= 0);
|
| off_t position = lseek(handle_->fd(), 0, SEEK_CUR);
|
| if (position < 0) {
|
| // The file is not capable of seeking. Return an error.
|
|
|