OLD | NEW |
---|---|
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/linux_util.h" | 5 #include "base/linux_util.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <glib.h> | 10 #include <glib.h> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 | 125 |
126 namespace base { | 126 namespace base { |
127 | 127 |
128 // Account for the terminating null character. | 128 // Account for the terminating null character. |
129 static const int kDistroSize = 128 + 1; | 129 static const int kDistroSize = 128 + 1; |
130 | 130 |
131 // We use this static string to hold the Linux distro info. If we | 131 // We use this static string to hold the Linux distro info. If we |
132 // crash, the crash handler code will send this in the crash dump. | 132 // crash, the crash handler code will send this in the crash dump. |
133 char g_linux_distro[kDistroSize] = | 133 char g_linux_distro[kDistroSize] = |
134 #if defined(OS_CHROMEOS) | 134 #if defined(OS_CHROMEOS) |
135 #if defined(TOUCH_UI) | |
Nico
2011/11/09 20:09:05
Would
#if defined(TOUCH_UI)
#elif defined(OS_CHRO
Rick Byers
2011/11/09 20:17:55
That wouldn't really be correct - we can have TOUC
Nico
2011/11/09 20:20:42
I like that a bit better, but it's fine either way
| |
136 "CrOS Touch"; | |
137 #else | |
135 "CrOS"; | 138 "CrOS"; |
139 #endif | |
136 #else // if defined(OS_LINUX) | 140 #else // if defined(OS_LINUX) |
137 "Unknown"; | 141 "Unknown"; |
138 #endif | 142 #endif |
139 | 143 |
140 std::string GetLinuxDistro() { | 144 std::string GetLinuxDistro() { |
141 #if defined(OS_CHROMEOS) | 145 #if defined(OS_CHROMEOS) |
142 return g_linux_distro; | 146 return g_linux_distro; |
143 #elif defined(OS_LINUX) | 147 #elif defined(OS_LINUX) |
144 LinuxDistroHelper* distro_state_singleton = LinuxDistroHelper::GetInstance(); | 148 LinuxDistroHelper* distro_state_singleton = LinuxDistroHelper::GetInstance(); |
145 LinuxDistroState state = distro_state_singleton->State(); | 149 LinuxDistroState state = distro_state_singleton->State(); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 | 300 |
297 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), | 301 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), |
298 expected_data.length())) { | 302 expected_data.length())) { |
299 return current_tid; | 303 return current_tid; |
300 } | 304 } |
301 } | 305 } |
302 return -1; | 306 return -1; |
303 } | 307 } |
304 | 308 |
305 } // namespace base | 309 } // namespace base |
OLD | NEW |