| Index: runtime/bin/file_macos.cc
|
| diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc
|
| index d1259f757fc3d875b80339b98434b06dca10553b..2b32bc1899fc263d5a36b3b8ee75a76c652ecd7e 100644
|
| --- a/runtime/bin/file_macos.cc
|
| +++ b/runtime/bin/file_macos.cc
|
| @@ -230,8 +230,7 @@ File* File::OpenStdio(int fd) {
|
| bool File::Exists(const char* name) {
|
| struct stat st;
|
| if (NO_RETRY_EXPECTED(stat(name, &st)) == 0) {
|
| - // Everything but a directory and a link is a file to Dart.
|
| - return !S_ISDIR(st.st_mode) && !S_ISLNK(st.st_mode);
|
| + return S_ISREG(st.st_mode);
|
| } else {
|
| return false;
|
| }
|
| @@ -243,22 +242,7 @@ bool File::Create(const char* name) {
|
| if (fd < 0) {
|
| return false;
|
| }
|
| - // File.create returns a File, so we shouldn't be giving the illusion that the
|
| - // call has created a file or that a file already exists if there is already
|
| - // an entity at the same path that is a directory or a link.
|
| - bool is_file = true;
|
| - struct stat st;
|
| - if (NO_RETRY_EXPECTED(fstat(fd, &st)) == 0) {
|
| - if (S_ISDIR(st.st_mode)) {
|
| - errno = EISDIR;
|
| - is_file = false;
|
| - } else if (S_ISLNK(st.st_mode)) {
|
| - errno = ENOENT;
|
| - is_file = false;
|
| - }
|
| - }
|
| - FDUtils::SaveErrorAndClose(fd);
|
| - return is_file;
|
| + return (close(fd) == 0);
|
| }
|
|
|
|
|
|
|