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

Unified Diff: runtime/bin/file_system_watcher_linux.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_fuchsia.cc ('k') | runtime/bin/file_system_watcher_macos.cc » ('j') | 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 bd9806ed9f766fa8ee9b5d050eae4ece628a3470..4a19d344f8c2d0c47d3db33305bf74471c0e006e 100644
--- a/runtime/bin/file_system_watcher_linux.cc
+++ b/runtime/bin/file_system_watcher_linux.cc
@@ -11,6 +11,7 @@
#include <sys/inotify.h> // NOLINT
#include "bin/fdutils.h"
+#include "bin/file.h"
#include "bin/socket.h"
#include "platform/signal_blocker.h"
@@ -38,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) {
@@ -54,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, path, list_events));
if (path_id < 0) {
return -1;
}
« no previous file with comments | « runtime/bin/file_system_watcher_fuchsia.cc ('k') | runtime/bin/file_system_watcher_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698