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

Side by Side Diff: base/sys_info_posix.cc

Issue 1542013005: Add a new driver bug workaround SANDBOX_START_EARLY Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add support for gn build Created 4 years, 7 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 | « .gn ('k') | build/config/linux/dri/BUILD.gn » ('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/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 NOTREACHED(); 106 NOTREACHED();
107 return std::string(); 107 return std::string();
108 } 108 }
109 return std::string(info.sysname); 109 return std::string(info.sysname);
110 } 110 }
111 #endif 111 #endif
112 112
113 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 113 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
114 // static 114 // static
115 std::string SysInfo::OperatingSystemVersion() { 115 std::string SysInfo::OperatingSystemVersion() {
116 struct utsname info; 116 static struct utsname info = {};
117 if (uname(&info) < 0) { 117 if (!strlen(info.release) && uname(&info) < 0) {
piman 2016/05/06 19:53:11 This is not thread safe. Why the change?
Julien Isorce Samsung 2016/05/07 08:18:13 Txh for pointing that, well I made this change bec
118 NOTREACHED(); 118 NOTREACHED();
119 return std::string(); 119 return std::string();
120 } 120 }
121 return std::string(info.release); 121 return std::string(info.release);
122 } 122 }
123 #endif 123 #endif
124 124
125 // static 125 // static
126 std::string SysInfo::OperatingSystemArchitecture() { 126 std::string SysInfo::OperatingSystemArchitecture() {
127 struct utsname info; 127 struct utsname info;
128 if (uname(&info) < 0) { 128 if (uname(&info) < 0) {
129 NOTREACHED(); 129 NOTREACHED();
130 return std::string(); 130 return std::string();
131 } 131 }
132 std::string arch(info.machine); 132 std::string arch(info.machine);
133 if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") { 133 if (arch == "i386" || arch == "i486" || arch == "i586" || arch == "i686") {
134 arch = "x86"; 134 arch = "x86";
135 } else if (arch == "amd64") { 135 } else if (arch == "amd64") {
136 arch = "x86_64"; 136 arch = "x86_64";
137 } 137 }
138 return arch; 138 return arch;
139 } 139 }
140 140
141 // static 141 // static
142 size_t SysInfo::VMAllocationGranularity() { 142 size_t SysInfo::VMAllocationGranularity() {
143 return getpagesize(); 143 return getpagesize();
144 } 144 }
145 145
146 } // namespace base 146 } // namespace base
OLDNEW
« no previous file with comments | « .gn ('k') | build/config/linux/dri/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698