| Index: runtime/bin/file_macos.cc
|
| diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
|
| index fccd648d5cab8c8f9e15fa5c8fe023c156d378e4..b5bc95a9c43c7c217aa56329e5c37f4be6d581a8 100644
|
| --- a/runtime/bin/file_macos.cc
|
| +++ b/runtime/bin/file_macos.cc
|
| @@ -12,6 +12,7 @@
|
| #include <limits.h>
|
|
|
| #include "bin/builtin.h"
|
| +#include "bin/fdutils.h"
|
|
|
| class FileHandle {
|
| public:
|
| @@ -116,11 +117,11 @@ File* File::Open(const char* name, FileOpenMode mode) {
|
| if ((mode & kTruncate) != 0) {
|
| flags = flags | O_TRUNC;
|
| }
|
| - flags |= O_CLOEXEC;
|
| int fd = TEMP_FAILURE_RETRY(open(name, flags, 0666));
|
| if (fd < 0) {
|
| return NULL;
|
| }
|
| + FDUtils::SetCloseOnExec(fd);
|
| if (((mode & kWrite) != 0) && ((mode & kTruncate) == 0)) {
|
| int position = TEMP_FAILURE_RETRY(lseek(fd, 0, SEEK_END));
|
| if (position < 0) {
|
| @@ -148,7 +149,7 @@ bool File::Exists(const char* name) {
|
|
|
|
|
| bool File::Create(const char* name) {
|
| - int fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_CREAT | O_CLOEXEC, 0666));
|
| + int fd = TEMP_FAILURE_RETRY(open(name, O_RDONLY | O_CREAT, 0666));
|
| if (fd < 0) {
|
| return false;
|
| }
|
|
|