summaryrefslogtreecommitdiffstats
path: root/base/file_util_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r--base/file_util_posix.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index d9cbe09..9db41fe 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>
#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");