diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-15 10:51:05 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-15 10:51:05 +0000 |
commit | 094797b7238716cc4f8128ae5765dfebbe7c8390 (patch) | |
tree | 61afe4da0dd73a8186b9b72190ec48991432aec9 /base/base_paths_posix.cc | |
parent | dd46a4ce7cf1de1f0eff98165c81c218503d1d12 (diff) | |
download | chromium_src-094797b7238716cc4f8128ae5765dfebbe7c8390.zip chromium_src-094797b7238716cc4f8128ae5765dfebbe7c8390.tar.gz chromium_src-094797b7238716cc4f8128ae5765dfebbe7c8390.tar.bz2 |
Cleanup: Add a const variable for /proc/self/exe.
Review URL: https://chromiumcodereview.appspot.com/10914279
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base_paths_posix.cc')
-rw-r--r-- | base/base_paths_posix.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/base/base_paths_posix.cc b/base/base_paths_posix.cc index 9be441d..95e7585 100644 --- a/base/base_paths_posix.cc +++ b/base/base_paths_posix.cc @@ -14,6 +14,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" +#include "base/process_util.h" #include "base/nix/xdg_util.h" #if defined(OS_FREEBSD) @@ -25,10 +26,6 @@ namespace base { -#if defined(OS_LINUX) -const char kSelfExe[] = "/proc/self/exe"; -#endif - bool PathProviderPosix(int key, FilePath* result) { FilePath path; switch (key) { @@ -36,8 +33,8 @@ bool PathProviderPosix(int key, FilePath* result) { case base::FILE_MODULE: { // TODO(evanm): is this correct? #if defined(OS_LINUX) FilePath bin_dir; - if (!file_util::ReadSymbolicLink(FilePath(kSelfExe), &bin_dir)) { - NOTREACHED() << "Unable to resolve " << kSelfExe << "."; + if (!file_util::ReadSymbolicLink(FilePath(kProcSelfExe), &bin_dir)) { + NOTREACHED() << "Unable to resolve " << kProcSelfExe << "."; return false; } *result = bin_dir; @@ -65,7 +62,7 @@ bool PathProviderPosix(int key, FilePath* result) { return true; #elif defined(OS_OPENBSD) // There is currently no way to get the executable path on OpenBSD - char *cpath; + char* cpath; if ((cpath = getenv("CHROME_EXE_PATH")) != NULL) *result = FilePath(cpath); else |