| Index: runtime/bin/file_system_watcher_linux.cc
|
| diff --git a/runtime/bin/file_system_watcher_linux.cc b/runtime/bin/file_system_watcher_linux.cc
|
| index b8aeab47ab5285a191c661379fa645bc56cf400b..4e574463f1b2bb0bc3fc81e6de357118bd5e2275 100644
|
| --- a/runtime/bin/file_system_watcher_linux.cc
|
| +++ b/runtime/bin/file_system_watcher_linux.cc
|
| @@ -10,6 +10,8 @@
|
| #include <errno.h> // NOLINT
|
| #include <sys/inotify.h> // NOLINT
|
|
|
| +#include "bin/fdutils.h"
|
| +
|
|
|
| namespace dart {
|
| namespace bin {
|
| @@ -22,8 +24,12 @@ bool FileSystemWatcher::IsSupported() {
|
| intptr_t FileSystemWatcher::WatchPath(const char* path,
|
| int events,
|
| bool recursive) {
|
| - int fd = TEMP_FAILURE_RETRY(inotify_init1(IN_NONBLOCK | IN_CLOEXEC));
|
| + int fd = TEMP_FAILURE_RETRY(inotify_init1(IN_CLOEXEC));
|
| if (fd < 0) return -1;
|
| + // Some systems dosn't support setting this as non-blocking. Since watching
|
| + // internals are kept away from the user, we know it's possible to continue,
|
| + // even if setting non-blocking fails.
|
| + FDUtils::SetNonBlocking(fd);
|
| int list_events = IN_DELETE_SELF | IN_MOVE_SELF;
|
| if (events & kCreate) list_events |= IN_CREATE;
|
| if (events & kModifyContent) list_events |= IN_CLOSE_WRITE | IN_ATTRIB;
|
|
|