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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } else if (STATE_CHECK_STARTED == state) { | 164 } else if (STATE_CHECK_STARTED == state) { |
165 // If the distro check above is in progress in some other thread, we're | 165 // If the distro check above is in progress in some other thread, we're |
166 // not going to wait for the results. | 166 // not going to wait for the results. |
167 return "Unknown"; | 167 return "Unknown"; |
168 } else { | 168 } else { |
169 // In STATE_CHECK_FINISHED, no more writing to |linux_distro|. | 169 // In STATE_CHECK_FINISHED, no more writing to |linux_distro|. |
170 return g_linux_distro; | 170 return g_linux_distro; |
171 } | 171 } |
172 #else | 172 #else |
173 NOTIMPLEMENTED(); | 173 NOTIMPLEMENTED(); |
| 174 return "Unknown"; |
174 #endif | 175 #endif |
175 } | 176 } |
176 | 177 |
177 void SetLinuxDistro(const std::string& distro) { | 178 void SetLinuxDistro(const std::string& distro) { |
178 std::string trimmed_distro; | 179 std::string trimmed_distro; |
179 TrimWhitespaceASCII(distro, TRIM_ALL, &trimmed_distro); | 180 TrimWhitespaceASCII(distro, TRIM_ALL, &trimmed_distro); |
180 base::strlcpy(g_linux_distro, trimmed_distro.c_str(), kDistroSize); | 181 base::strlcpy(g_linux_distro, trimmed_distro.c_str(), kDistroSize); |
181 } | 182 } |
182 | 183 |
183 bool FileDescriptorGetInode(ino_t* inode_out, int fd) { | 184 bool FileDescriptorGetInode(ino_t* inode_out, int fd) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 296 |
296 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), | 297 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), |
297 expected_data.length())) { | 298 expected_data.length())) { |
298 return current_tid; | 299 return current_tid; |
299 } | 300 } |
300 } | 301 } |
301 return -1; | 302 return -1; |
302 } | 303 } |
303 | 304 |
304 } // namespace base | 305 } // namespace base |
OLD | NEW |