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

Side by Side Diff: src/platform-linux.cc

Issue 13465003: ARM: Log an error if /proc/cpuinfo cannot be opened (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 #ifdef __arm__ 104 #ifdef __arm__
105 static bool CPUInfoContainsString(const char * search_string) { 105 static bool CPUInfoContainsString(const char * search_string) {
106 const char* file_name = "/proc/cpuinfo"; 106 const char* file_name = "/proc/cpuinfo";
107 // This is written as a straight shot one pass parser 107 // This is written as a straight shot one pass parser
108 // and not using STL string and ifstream because, 108 // and not using STL string and ifstream because,
109 // on Linux, it's reading from a (non-mmap-able) 109 // on Linux, it's reading from a (non-mmap-able)
110 // character special device. 110 // character special device.
111 FILE* f = NULL; 111 FILE* f = NULL;
112 const char* what = search_string; 112 const char* what = search_string;
113 113
114 if (NULL == (f = fopen(file_name, "r"))) 114 if (NULL == (f = fopen(file_name, "r"))) {
115 OS::PrintError("Failed to open /proc/cpuinfo\n");
115 return false; 116 return false;
117 }
116 118
117 int k; 119 int k;
118 while (EOF != (k = fgetc(f))) { 120 while (EOF != (k = fgetc(f))) {
119 if (k == *what) { 121 if (k == *what) {
120 ++what; 122 ++what;
121 while ((*what != '\0') && (*what == fgetc(f))) { 123 while ((*what != '\0') && (*what == fgetc(f))) {
122 ++what; 124 ++what;
123 } 125 }
124 if (*what == '\0') { 126 if (*what == '\0') {
125 fclose(f); 127 fclose(f);
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 1327
1326 1328
1327 void Sampler::Stop() { 1329 void Sampler::Stop() {
1328 ASSERT(IsActive()); 1330 ASSERT(IsActive());
1329 SignalSender::RemoveActiveSampler(this); 1331 SignalSender::RemoveActiveSampler(this);
1330 SetActive(false); 1332 SetActive(false);
1331 } 1333 }
1332 1334
1333 1335
1334 } } // namespace v8::internal 1336 } } // namespace v8::internal
OLDNEW
« 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