Merge "[Stability][hwui] check mmap return value"

This commit is contained in:
Treehugger Robot
2018-06-21 20:13:36 +00:00
committed by Gerrit Code Review

View File

@@ -134,7 +134,7 @@ bool GraphicsStatsService::parseFromFile(const std::string& path, service::Graph
return false; return false;
} }
void* addr = mmap(nullptr, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); void* addr = mmap(nullptr, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (!addr) { if (addr == MAP_FAILED) {
int err = errno; int err = errno;
// The file not existing is normal for addToDump(), so only log if // The file not existing is normal for addToDump(), so only log if
// we get an unexpected error // we get an unexpected error