Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2810)

Unified Diff: base/base_paths_posix.cc

Issue 10914279: Cleanup: Add a const variable for /proc/self/exe. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base_paths_android.cc ('k') | base/process_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths_posix.cc
===================================================================
--- base/base_paths_posix.cc (revision 156845)
+++ base/base_paths_posix.cc (working copy)
@@ -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 @@
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 @@
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
« no previous file with comments | « base/base_paths_android.cc ('k') | base/process_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698