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

Unified Diff: runtime/bin/file_system_watcher_android.cc

Issue 3001963002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Fuchsia fix Created 3 years, 4 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 | « runtime/bin/file_system_watcher.cc ('k') | runtime/bin/file_system_watcher_fuchsia.cc » ('j') | 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 08619f2b21efd8f9b7d4ecbe725691742fe7c8c2..684df7a1c2133df185bb8a64b61690ca1d1ddfcb 100644
--- a/runtime/bin/file_system_watcher_android.cc
+++ b/runtime/bin/file_system_watcher_android.cc
@@ -11,6 +11,8 @@
#include <sys/inotify.h> // NOLINT
#include "bin/fdutils.h"
+#include "bin/file.h"
+#include "bin/socket.h"
#include "platform/signal_blocker.h"
namespace dart {
@@ -37,6 +39,7 @@ void FileSystemWatcher::Close(intptr_t id) {
}
intptr_t FileSystemWatcher::WatchPath(intptr_t id,
+ Namespace* namespc,
const char* path,
int events,
bool recursive) {
@@ -53,7 +56,10 @@ intptr_t FileSystemWatcher::WatchPath(intptr_t id,
if ((events & kMove) != 0) {
list_events |= IN_MOVE;
}
- int path_id = NO_RETRY_EXPECTED(inotify_add_watch(id, path, list_events));
+ const char* resolved_path = File::GetCanonicalPath(namespc, path);
+ path = resolved_path != NULL ? resolved_path : path;
+ int path_id = NO_RETRY_EXPECTED(inotify_add_watch(
+ id, resolved_path, list_events));
if (path_id < 0) {
return -1;
}
« no previous file with comments | « runtime/bin/file_system_watcher.cc ('k') | runtime/bin/file_system_watcher_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698