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

Unified Diff: base/base_paths_linux.cc

Issue 7238021: Solaris patch (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fixed some sysctl includes Created 9 years, 6 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 | « no previous file | base/debug/debugger_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths_linux.cc
diff --git a/base/base_paths_linux.cc b/base/base_paths_linux.cc
index 2ee690da881578db9a7259e39330db28f52b54ac..9f940cb986cb4d6145401c1d3c0a74dbf380e2fe 100644
--- a/base/base_paths_linux.cc
+++ b/base/base_paths_linux.cc
@@ -19,14 +19,14 @@
#if defined(OS_FREEBSD)
#include <sys/param.h>
#include <sys/sysctl.h>
+#elif defined(OS_SOLARIS)
+#include <stdlib.h>
#endif
namespace base {
#if defined(OS_LINUX)
const char kSelfExe[] = "/proc/self/exe";
-#elif defined(OS_SOLARIS)
-const char kSelfExe[] = getexecname();
#endif
// The name of this file relative to the source root. This is used for checking
@@ -58,6 +58,14 @@ bool PathProviderPosix(int key, FilePath* result) {
bin_dir[strlen(bin_dir)] = 0;
*result = FilePath(bin_dir);
return true;
+#elif defined(OS_SOLARIS)
+ char bin_dir[PATH_MAX + 1];
+ if (realpath(getexecname(), bin_dir) == NULL) {
+ NOTREACHED() << "Unable to resolve " << getexecname() << ".";
+ return false;
+ }
+ *result = FilePath(bin_dir);
+ return true;
#endif
}
case base::DIR_SOURCE_ROOT: {
« no previous file with comments | « no previous file | base/debug/debugger_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698