chromium 11.0.969.72
[chromium.git] / patches / patch-base_base__paths__linux.cc
1 $NetBSD$
2
3 --- base/base_paths_linux.cc.orig       2011-05-24 08:01:33.000000000 +0000
4 +++ base/base_paths_linux.cc
5 @@ -5,7 +5,7 @@
6  #include "base/base_paths.h"
7  
8  #include <unistd.h>
9 -#if defined(OS_FREEBSD)
10 +#if defined(OS_BSD)
11  #include <sys/param.h>
12  #include <sys/sysctl.h>
13  #endif
14 @@ -21,7 +21,7 @@
15  
16  namespace base {
17  
18 -#if defined(OS_LINUX)
19 +#if defined(OS_LINUX) || defined(OS_NETBSD)
20  const char kSelfExe[] = "/proc/self/exe";
21  #elif defined(OS_SOLARIS)
22  const char kSelfExe[] = getexecname();
23 @@ -36,7 +36,7 @@ bool PathProviderPosix(int key, FilePath
24    switch (key) {
25      case base::FILE_EXE:
26      case base::FILE_MODULE: {  // TODO(evanm): is this correct?
27 -#if defined(OS_LINUX)
28 +#if defined(OS_LINUX) || defined(OS_NETBSD)
29        FilePath bin_dir;
30        if (!file_util::ReadSymbolicLink(FilePath(kSelfExe), &bin_dir)) {
31          NOTREACHED() << "Unable to resolve " << kSelfExe << ".";
32 @@ -56,6 +56,9 @@ bool PathProviderPosix(int key, FilePath
33        bin_dir[strlen(bin_dir)] = 0;
34        *result = FilePath(bin_dir);
35        return true;
36 +#elif defined(OS_OPENBSD) || defined(OS_DRAGONFLY)
37 +      *result = FilePath("/usr/local/share/chromium/chrome");
38 +      return true;
39  #endif
40      }
41      case base::DIR_SOURCE_ROOT: {