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 |