Commit e9688262 authored by mostynb@opera.com's avatar mostynb@opera.com

simplify posix MappedFile::Init and add useful logs

This ancient CL suggested a simplication in mapped_file_posix.cc:
https://codereview.chromium.org/160288

After hitting this DCHECK on an embedded device where using a debugger
is difficult, I decided to make the suggested change and add some useful
logging while I was at it.

BUG=391937

Review URL: https://codereview.chromium.org/372113003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281747 0039d316-1c4b-4281-b951-d872f2087c98
parent 965c3523
...@@ -26,8 +26,8 @@ void* MappedFile::Init(const base::FilePath& name, size_t size) { ...@@ -26,8 +26,8 @@ void* MappedFile::Init(const base::FilePath& name, size_t size) {
platform_file(), 0); platform_file(), 0);
init_ = true; init_ = true;
view_size_ = size; view_size_ = size;
DCHECK(reinterpret_cast<intptr_t>(buffer_) != -1); DPLOG_IF(FATAL, buffer_ == MAP_FAILED) << "Failed to mmap " << name.value();
if (reinterpret_cast<intptr_t>(buffer_) == -1) if (buffer_ == MAP_FAILED)
buffer_ = 0; buffer_ = 0;
// Make sure we detect hardware failures reading the headers. // Make sure we detect hardware failures reading the headers.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment