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

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 156679)
+++ base/base_paths_posix.cc (working copy)
@@ -23,12 +23,12 @@
#include <stdlib.h>
#endif
-namespace base {
-
#if defined(OS_LINUX)
-const char kSelfExe[] = "/proc/self/exe";
+#include "base/process_util.h"
brettw 2012/09/14 21:56:52 I'd put this above and not in an ifdef.
Lei Zhang 2012/09/14 22:00:54 Done.
#endif
+namespace base {
+
bool PathProviderPosix(int key, FilePath* result) {
FilePath path;
switch (key) {
@@ -36,8 +36,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 +65,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