| Index: runtime/bin/file_linux.cc
|
| diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
|
| index 309971531c94050179c43745ca745f0f6d541a4b..c8a0b4926d4239255aa3c7832bdb50157656932a 100644
|
| --- a/runtime/bin/file_linux.cc
|
| +++ b/runtime/bin/file_linux.cc
|
| @@ -38,7 +38,9 @@ class FileHandle {
|
|
|
|
|
| File::~File() {
|
| - Close();
|
| + if (!IsClosed()) {
|
| + Close();
|
| + }
|
| delete handle_;
|
| }
|
|
|
| @@ -196,10 +198,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));
|
| }
|
|
|
|
|
|
|