Chromium Code Reviews| Index: net/disk_cache/blockfile/mapped_file_posix.cc |
| diff --git a/net/disk_cache/blockfile/mapped_file_posix.cc b/net/disk_cache/blockfile/mapped_file_posix.cc |
| index 966fc72686e7b6e2f33bcc4ac4e824027f81806e..159bb95de820d7c2e2e1d6cfdfb2fc4ce2ff6600 100644 |
| --- a/net/disk_cache/blockfile/mapped_file_posix.cc |
| +++ b/net/disk_cache/blockfile/mapped_file_posix.cc |
| @@ -5,6 +5,7 @@ |
| #include "net/disk_cache/blockfile/mapped_file.h" |
| #include <errno.h> |
| +#include <string.h> |
|
rvargas (doing something else)
2014/07/07 23:30:32
(and this should not be needed)
Mostyn Bramley-Moore
2014/07/08 08:07:19
Done.
|
| #include <sys/mman.h> |
| #include "base/files/file_path.h" |
| @@ -26,8 +27,9 @@ void* MappedFile::Init(const base::FilePath& name, size_t size) { |
| platform_file(), 0); |
| init_ = true; |
| view_size_ = size; |
| - DCHECK(reinterpret_cast<intptr_t>(buffer_) != -1); |
| - if (reinterpret_cast<intptr_t>(buffer_) == -1) |
| + DLOG_IF(FATAL, buffer_ == MAP_FAILED) << "Failed to mmap " << name.value() |
| + << ": " << strerror(errno); |
|
rvargas (doing something else)
2014/07/07 23:30:32
nit: use DPLOG_IF instead
Mostyn Bramley-Moore
2014/07/08 08:07:19
I hadn't noticed the P logging macros before- nice
|
| + if (buffer_ == MAP_FAILED) |
| buffer_ = 0; |
| // Make sure we detect hardware failures reading the headers. |