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

Side by Side Diff: base/base_paths_linux.cc

Issue 8228005: openbsd and freebsd fixes for base (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add myself to the AUTHORS Created 9 years, 2 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 unified diff | Download patch
« no previous file with comments | « base/base.gypi ('k') | base/basictypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/base_paths.h" 5 #include "base/base_paths.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 #include <string> 8 #include <string>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 *result = FilePath(bin_dir); 59 *result = FilePath(bin_dir);
60 return true; 60 return true;
61 #elif defined(OS_SOLARIS) 61 #elif defined(OS_SOLARIS)
62 char bin_dir[PATH_MAX + 1]; 62 char bin_dir[PATH_MAX + 1];
63 if (realpath(getexecname(), bin_dir) == NULL) { 63 if (realpath(getexecname(), bin_dir) == NULL) {
64 NOTREACHED() << "Unable to resolve " << getexecname() << "."; 64 NOTREACHED() << "Unable to resolve " << getexecname() << ".";
65 return false; 65 return false;
66 } 66 }
67 *result = FilePath(bin_dir); 67 *result = FilePath(bin_dir);
68 return true; 68 return true;
69 #elif defined(OS_OPENBSD)
70 // There is currently no way to get the executable path on OpenBSD
71 *result = FilePath("/usr/local/chrome/chrome");
72 return true;
69 #endif 73 #endif
70 } 74 }
71 case base::DIR_SOURCE_ROOT: { 75 case base::DIR_SOURCE_ROOT: {
72 // Allow passing this in the environment, for more flexibility in build 76 // Allow passing this in the environment, for more flexibility in build
73 // tree configurations (sub-project builds, gyp --output_dir, etc.) 77 // tree configurations (sub-project builds, gyp --output_dir, etc.)
74 scoped_ptr<base::Environment> env(base::Environment::Create()); 78 scoped_ptr<base::Environment> env(base::Environment::Create());
75 std::string cr_source_root; 79 std::string cr_source_root;
76 if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) { 80 if (env->GetVar("CR_SOURCE_ROOT", &cr_source_root)) {
77 path = FilePath(cr_source_root); 81 path = FilePath(cr_source_root);
78 if (file_util::PathExists(path.Append(kThisSourceFile))) { 82 if (file_util::PathExists(path.Append(kThisSourceFile))) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 scoped_ptr<base::Environment> env(base::Environment::Create()); 121 scoped_ptr<base::Environment> env(base::Environment::Create());
118 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", 122 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME",
119 ".cache")); 123 ".cache"));
120 *result = cache_dir; 124 *result = cache_dir;
121 return true; 125 return true;
122 } 126 }
123 return false; 127 return false;
124 } 128 }
125 129
126 } // namespace base 130 } // namespace base
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/basictypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698