| Index: runtime/bin/file_macos.cc
|
| diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
|
| index 1b5ee0412284013032a881846c5478701cf65906..03c27c3ba114d108487a0939cee8dc2aece45b86 100644
|
| --- a/runtime/bin/file_macos.cc
|
| +++ b/runtime/bin/file_macos.cc
|
| @@ -40,7 +40,9 @@ class FileHandle {
|
|
|
|
|
| File::~File() {
|
| - Close();
|
| + if (!IsClosed()) {
|
| + Close();
|
| + }
|
| delete handle_;
|
| }
|
|
|
| @@ -199,10 +201,7 @@ File* File::Open(const char* path, FileOpenMode mode) {
|
|
|
|
|
| File* File::OpenStdio(int fd) {
|
| - if ((fd < 0) || (2 < fd)) {
|
| - return NULL;
|
| - }
|
| - return new File(new FileHandle(fd));
|
| + return ((fd < 0) || (2 < fd)) ? NULL : new File(new FileHandle(fd));
|
| }
|
|
|
|
|
|
|