summaryrefslogtreecommitdiffstats
path: root/base/file_util_posix.cc
diff options
context:
space:
mode:
authorgspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 17:37:54 +0000
committergspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 17:37:54 +0000
commit723571af3c1a86aa14a68bce2511f3dad399287f (patch)
treec77043d78d5eb7eb1437071561fce7c8ad9b4a5d /base/file_util_posix.cc
parent0868ee7ae6d7fbb63ab85dfeafa34d724f9a1b45 (diff)
downloadchromium_src-723571af3c1a86aa14a68bce2511f3dad399287f.zip
chromium_src-723571af3c1a86aa14a68bce2511f3dad399287f.tar.gz
chromium_src-723571af3c1a86aa14a68bce2511f3dad399287f.tar.bz2
Start using file_util symlink code, now that it's available.
In CL http://codereview.chromium.org/5349007 I added some base API for manipulating symlinks (since I needed it for some ChromeOS code and noticed that other places could use it too), and this just starts using that API. BUG=none TEST=Ran ui_tests, passed trybots. Review URL: http://codereview.chromium.org/5286010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r--base/file_util_posix.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index e71051e..92527c8 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -388,11 +388,12 @@ bool ReadSymbolicLink(const FilePath& symlink_path,
char buf[PATH_MAX];
ssize_t count = ::readlink(symlink_path.value().c_str(), buf, arraysize(buf));
- if (count <= 0)
+ if (count <= 0) {
+ target_path->clear();
return false;
+ }
*target_path = FilePath(FilePath::StringType(buf, count));
-
return true;
}