diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-12 06:07:25 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-12 06:07:25 +0000 |
commit | b266ffea340315ef1cee2c69afe314b545c08d91 (patch) | |
tree | bfaf304ed986ac5490474772ad85a06eb658edf6 /base/base_paths_mac.mm | |
parent | b5d41bf892f31b76ca39da16174d00378996b389 (diff) | |
download | chromium_src-b266ffea340315ef1cee2c69afe314b545c08d91.zip chromium_src-b266ffea340315ef1cee2c69afe314b545c08d91.tar.gz chromium_src-b266ffea340315ef1cee2c69afe314b545c08d91.tar.bz2 |
Fix problems in src/base:
- de-facto ignored return value of PathService::Get in base_paths_mac.mm
- missing EINTR handling in other files
I was just reading the code looking for some issues.
BUG=none
Review URL: http://codereview.chromium.org/6820030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_mac.mm')
-rw-r--r-- | base/base_paths_mac.mm | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/base/base_paths_mac.mm b/base/base_paths_mac.mm index 1210834..ec1398b 100644 --- a/base/base_paths_mac.mm +++ b/base/base_paths_mac.mm @@ -53,19 +53,20 @@ bool PathProviderMac(int key, FilePath* result) { return base::mac::GetUserDirectory(NSApplicationSupportDirectory, result); case base::DIR_SOURCE_ROOT: { // Go through PathService to catch overrides. - if (PathService::Get(base::FILE_EXE, result)) { - // Start with the executable's directory. - *result = result->DirName(); - if (base::mac::AmIBundled()) { - // The bundled app executables (Chromium, TestShell, etc) live five - // levels down, eg: - // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium - *result = result->DirName().DirName().DirName().DirName().DirName(); - } else { - // Unit tests execute two levels deep from the source root, eg: - // src/xcodebuild/{Debug|Release}/base_unittests - *result = result->DirName().DirName(); - } + if (!PathService::Get(base::FILE_EXE, result)) + return false; + + // Start with the executable's directory. + *result = result->DirName(); + if (base::mac::AmIBundled()) { + // The bundled app executables (Chromium, TestShell, etc) live five + // levels down, eg: + // src/xcodebuild/{Debug|Release}/Chromium.app/Contents/MacOS/Chromium + *result = result->DirName().DirName().DirName().DirName().DirName(); + } else { + // Unit tests execute two levels deep from the source root, eg: + // src/xcodebuild/{Debug|Release}/base_unittests + *result = result->DirName().DirName(); } return true; } |