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

Unified Diff: base/file_util_posix.cc

Issue 2001013: Use realpath() to find the path to the extension unpack dir on posix systems. (Closed)
Patch Set: Created 10 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
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_posix.cc
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index d9cbe0945e75fe3be45dd380affcf445c0051a25..9db41fe95b196c20e7541f66c9bf23809ade696d 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -14,6 +14,7 @@
#include <string.h>
#include <sys/errno.h>
#include <sys/mman.h>
+#include <sys/param.h>
Lei Zhang 2010/05/12 18:53:32 nit: My Linux man page says this should be <limits
Sam Kerner (Chrome) 2010/05/12 20:02:57 I used the mac man page, then tested on linux...
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -735,6 +736,15 @@ bool HasFileBeenModifiedSince(const FileEnumerator::FindInfo& find_info,
return find_info.stat.st_mtime >= cutoff_time.ToTimeT();
}
+bool RealPath(const FilePath& path, FilePath* real_path) {
+ FilePath::CharType buf[PATH_MAX];
+ if (!realpath(path.value().c_str(), buf))
+ return false;
+
+ *real_path = FilePath(buf);
+ return true;
+}
+
#if !defined(OS_MACOSX)
bool GetTempDir(FilePath* path) {
const char* tmp = getenv("TMPDIR");
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698