summaryrefslogtreecommitdiffstats
path: root/base/shared_memory_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/shared_memory_posix.cc')
-rw-r--r--base/shared_memory_posix.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index fe4b225..55adcb4 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -225,7 +225,14 @@ bool SharedMemory::CreateOrOpen(const std::wstring &name,
}
mapped_file_ = dup(fileno(fp));
- DCHECK(mapped_file_ >= 0);
+ if (mapped_file_ == -1) {
+ if (errno == EMFILE) {
+ LOG(WARNING) << "Shared memory creation failed; out of file descriptors";
+ return false;
+ } else {
+ NOTREACHED() << "Call to dup failed, errno=" << errno;
+ }
+ }
struct stat st;
if (fstat(mapped_file_, &st))