summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 19:10:28 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 19:10:28 +0000
commite131cf56c776248bb22d234ad806aafb64869e5a (patch)
tree69d29b97458c45ca253c3e9585dff136e66b70f1 /base
parente153cff78f5553d39a8c68dd2caf6adf60a2e2f8 (diff)
downloadchromium_src-e131cf56c776248bb22d234ad806aafb64869e5a.zip
chromium_src-e131cf56c776248bb22d234ad806aafb64869e5a.tar.gz
chromium_src-e131cf56c776248bb22d234ad806aafb64869e5a.tar.bz2
posix: stat() uses errno, not its return value, for errors
l/stat() always return -1 on error, so we must examine errno if we want to handle errors specially. (This is only used for judging whether to print an error message, so it's not too harmful.) TEST=symlink to nowhere in a dir; Chrome should not complain about that symlink when enumerating files in the directory Review URL: http://codereview.chromium.org/1352001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_util_posix.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 4a86261..2047636 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -659,7 +659,7 @@ bool FileEnumerator::ReadDirectory(std::vector<DirectoryEntryInfo>* entries,
if (ret < 0) {
// Print the stat() error message unless it was ENOENT and we're
// following symlinks.
- if (!(ret == ENOENT && !show_links)) {
+ if (!(errno == ENOENT && !show_links)) {
PLOG(ERROR) << "Couldn't stat "
<< source.Append(dent->d_name).value();
}