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

Unified Diff: runtime/vm/cpuinfo_macos.cc

Issue 1150173004: - Make sure to properly check for errors from sysctlbyname. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/cpuinfo_macos.cc
diff --git a/runtime/vm/cpuinfo_macos.cc b/runtime/vm/cpuinfo_macos.cc
index 6300d7c7f7298a130c562ffd6d59ba78198ccd4c..63523914ddf4c2bd581ebe4e2edb897b2e3c46cd 100644
--- a/runtime/vm/cpuinfo_macos.cc
+++ b/runtime/vm/cpuinfo_macos.cc
@@ -85,7 +85,7 @@ bool CpuInfo::HasField(const char* field) {
ASSERT(method_ != kCpuInfoDefault);
ASSERT(field != NULL);
int ret = sysctlbyname(field, NULL, NULL, NULL, 0);
- return (ret != ENOENT);
+ return (ret == 0);
}
} // namespace dart
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698