Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: runtime/bin/file_system_watcher_android.cc

Issue 23978006: Fix android build of runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_system_watcher_android.cc
diff --git a/runtime/bin/file_system_watcher_android.cc b/runtime/bin/file_system_watcher_android.cc
index 35246946eb8b6ca8d32b553ef8d9b027105a3d1c..63a244a162dc7475766c1bf78060625a94651028 100644
--- a/runtime/bin/file_system_watcher_android.cc
+++ b/runtime/bin/file_system_watcher_android.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,10 @@ 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));
- if (fd < 0) return -1;
+ int fd = TEMP_FAILURE_RETRY(inotify_init());
+ if (fd < 0 || !FDUtils::SetNonBlocking(fd) || !FDUtils::SetCloseOnExec(fd)) {
+ return -1;
+ }
int list_events = 0;
if (events & kCreate) list_events |= IN_CREATE;
if (events & kModifyContent) list_events |= IN_MODIFY | IN_ATTRIB;
@@ -90,4 +94,3 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id) {
} // namespace dart
#endif // defined(TARGET_OS_ANDROID)
-
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698