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

Unified Diff: base/shared_memory_posix.cc

Issue 21238: Fix error checking for mmap() for POSIX shared memory. (Closed)
Patch Set: Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/ipc_send_fds_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/shared_memory_posix.cc
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index a28672e2357bdd00d1bbfaa11785876ac3807488..bd33cda006d6ec08557cf2ebb8d32208e6ef86e8 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -214,7 +214,9 @@ bool SharedMemory::Map(size_t bytes) {
if (memory_)
max_size_ = bytes;
- return (memory_ != NULL);
+ bool mmap_succeeded = (memory_ != (void*)-1);
+ DCHECK(mmap_succeeded) << "Call to mmap failed, errno=" << errno;
+ return mmap_succeeded;
}
bool SharedMemory::Unmap() {
« no previous file with comments | « no previous file | chrome/common/ipc_send_fds_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698