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

Unified Diff: runtime/bin/file_system_watcher_linux.cc

Issue 48183003: Only listen to full writes, not incremental file changes, in file system watch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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_linux.cc
diff --git a/runtime/bin/file_system_watcher_linux.cc b/runtime/bin/file_system_watcher_linux.cc
index da5dee1ec77b56592c766ca363cac64fa9fa17d9..9c5b6b516912de2acf6b7c0244e285d015867583 100644
--- a/runtime/bin/file_system_watcher_linux.cc
+++ b/runtime/bin/file_system_watcher_linux.cc
@@ -26,7 +26,7 @@ intptr_t FileSystemWatcher::WatchPath(const char* path,
if (fd < 0) return -1;
int list_events = IN_DELETE_SELF;
if (events & kCreate) list_events |= IN_CREATE;
- if (events & kModifyContent) list_events |= IN_MODIFY | IN_ATTRIB;
+ if (events & kModifyContent) list_events |= IN_CLOSE_WRITE | IN_ATTRIB;
if (events & kDelete) list_events |= IN_DELETE;
if (events & kMove) list_events |= IN_MOVE;
int path_fd = TEMP_FAILURE_RETRY(inotify_add_watch(fd, path, list_events));
@@ -65,7 +65,7 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id) {
reinterpret_cast<struct inotify_event*>(buffer + offset);
Dart_Handle event = Dart_NewList(3);
int mask = 0;
- if (e->mask & IN_MODIFY) mask |= kModifyContent;
+ if (e->mask & IN_CLOSE_WRITE) mask |= kModifyContent;
if (e->mask & IN_ATTRIB) mask |= kModefyAttribute;
if (e->mask & IN_CREATE) mask |= kCreate;
if (e->mask & IN_MOVE) mask |= kMove;
« 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