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

Unified Diff: base/file_util_posix.cc

Issue 115229: Add support for almost-recursive watches in Linux DirectoryWatcher (Closed)
Patch Set: fix NULL file_thread scenario Created 11 years, 7 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
Index: base/file_util_posix.cc
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index ae296cac95b96d4be2f0cea1f2f3e1ef8db84ece..96c1c177644222cac97e0dda6e65248b02f3044a 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -440,6 +440,16 @@ bool GetFileInfo(const FilePath& file_path, FileInfo* results) {
return true;
}
+bool GetInode(const FilePath& path, ino_t* inode) {
+ struct stat buffer;
+ int result = stat(path.value().c_str(), &buffer);
+ if (result < 0)
+ return false;
+
+ *inode = buffer.st_ino;
+ return true;
+}
+
FILE* OpenFile(const std::string& filename, const char* mode) {
return OpenFile(FilePath(filename), mode);
}

Powered by Google App Engine
This is Rietveld 408576698