| Index: base/shared_memory_posix.cc
|
| diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
|
| index 34403c464c0f91f73c4e8602b94afecfbb39c473..1261d508d4275b7dbf099c8e0d951a87dfb37c97 100644
|
| --- a/base/shared_memory_posix.cc
|
| +++ b/base/shared_memory_posix.cc
|
| @@ -239,11 +239,12 @@ bool SharedMemory::Map(uint32 bytes) {
|
| memory_ = mmap(NULL, bytes, PROT_READ | (read_only_ ? 0 : PROT_WRITE),
|
| MAP_SHARED, mapped_file_, 0);
|
|
|
| - if (memory_)
|
| + bool mmap_succeeded = memory_ != (void*)-1 && memory_ != NULL;
|
| + if (mmap_succeeded)
|
| mapped_size_ = bytes;
|
| + else
|
| + memory_ = NULL;
|
|
|
| - bool mmap_succeeded = (memory_ != (void*)-1);
|
| - DCHECK(mmap_succeeded) << "Call to mmap failed, errno=" << errno;
|
| return mmap_succeeded;
|
| }
|
|
|
|
|