| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdlib.h> | 10 #include <stdlib.h> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 distro_state_singleton->CheckFinished(); | 169 distro_state_singleton->CheckFinished(); |
| 170 return g_linux_distro; | 170 return g_linux_distro; |
| 171 #else | 171 #else |
| 172 NOTIMPLEMENTED(); | 172 NOTIMPLEMENTED(); |
| 173 return "Unknown"; | 173 return "Unknown"; |
| 174 #endif | 174 #endif |
| 175 } | 175 } |
| 176 | 176 |
| 177 void SetLinuxDistro(const std::string& distro) { | 177 void SetLinuxDistro(const std::string& distro) { |
| 178 std::string trimmed_distro; | 178 std::string trimmed_distro; |
| 179 TrimWhitespaceASCII(distro, TRIM_ALL, &trimmed_distro); | 179 base::TrimWhitespaceASCII(distro, base::TRIM_ALL, &trimmed_distro); |
| 180 base::strlcpy(g_linux_distro, trimmed_distro.c_str(), kDistroSize); | 180 base::strlcpy(g_linux_distro, trimmed_distro.c_str(), kDistroSize); |
| 181 } | 181 } |
| 182 | 182 |
| 183 bool FileDescriptorGetInode(ino_t* inode_out, int fd) { | 183 bool FileDescriptorGetInode(ino_t* inode_out, int fd) { |
| 184 DCHECK(inode_out); | 184 DCHECK(inode_out); |
| 185 | 185 |
| 186 struct stat buf; | 186 struct stat buf; |
| 187 if (fstat(fd, &buf) < 0) | 187 if (fstat(fd, &buf) < 0) |
| 188 return false; | 188 return false; |
| 189 | 189 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), | 295 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), |
| 296 expected_data.length())) { | 296 expected_data.length())) { |
| 297 return current_tid; | 297 return current_tid; |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 return -1; | 300 return -1; |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace base | 303 } // namespace base |
| OLD | NEW |