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

Side by Side Diff: base/linux_util.cc

Issue 8382001: OpenBSD patches for base and build, part 2 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove newline from string 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/file_util_posix.cc ('k') | base/sys_info_freebsd.cc » ('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/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
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
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
OLDNEW
« no previous file with comments | « base/file_util_posix.cc ('k') | base/sys_info_freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698