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, 2 insertions, 8 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 579e79a..0436c73 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -306,14 +306,8 @@ bool PathExists(const FilePath& path) {
bool PathIsWritable(const FilePath& path) {
FilePath test_path(path);
stat_wrapper_t file_info;
- if (CallStat(test_path.value().c_str(), &file_info) != 0) {
- // If the path doesn't exist, test the parent dir.
- test_path = test_path.DirName();
- // If the parent dir doesn't exist, then return false (the path is not
- // directly writable).
- if (CallStat(test_path.value().c_str(), &file_info) != 0)
- return false;
- }
+ if (CallStat(test_path.value().c_str(), &file_info) != 0)
+ return false;
if (S_IWOTH & file_info.st_mode)
return true;
if (getegid() == file_info.st_gid && (S_IWGRP & file_info.st_mode))