| Index: runtime/bin/file_android.cc
|
| diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
|
| index a115715b2c3209bb16b0071d1d75d5aad8665ffa..f1f120d22837baf3cdd5cd297c22c737b9c1b7fc 100644
|
| --- a/runtime/bin/file_android.cc
|
| +++ b/runtime/bin/file_android.cc
|
| @@ -39,7 +39,9 @@ class FileHandle {
|
|
|
|
|
| File::~File() {
|
| - Close();
|
| + if (!IsClosed()) {
|
| + Close();
|
| + }
|
| delete handle_;
|
| }
|
|
|
| @@ -197,10 +199,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));
|
| }
|
|
|
|
|
|
|