summaryrefslogtreecommitdiffstats
path: root/base/shared_memory_posix.cc
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 21:37:41 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 21:37:41 +0000
commitbe60b9a5c94c8439c236a820505ebad04460efc0 (patch)
treefcfb2b788bba22e24d050f799e5d6edf8f61f241 /base/shared_memory_posix.cc
parent2380f378654e66f58262e3eaa1f9ba0cd1da09e0 (diff)
downloadchromium_src-be60b9a5c94c8439c236a820505ebad04460efc0.zip
chromium_src-be60b9a5c94c8439c236a820505ebad04460efc0.tar.gz
chromium_src-be60b9a5c94c8439c236a820505ebad04460efc0.tar.bz2
Dup command-buffer SHM handle before auto-closing.
This also adds error logging to the various places we close file descriptors, to help diagnosing future similar issues. BUG=none TEST=Pepper Flash + youtube in oop with --enable-accelerated-plugins Review URL: http://codereview.chromium.org/6549037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/shared_memory_posix.cc')
-rw-r--r--base/shared_memory_posix.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index 843322b..cafda5a 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -79,7 +79,8 @@ SharedMemoryHandle SharedMemory::NULLHandle() {
// static
void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
DCHECK(handle.fd >= 0);
- close(handle.fd);
+ if (HANDLE_EINTR(close(handle.fd)) < 0)
+ PLOG(ERROR) << "close";
}
bool SharedMemory::CreateAndMapAnonymous(uint32 size) {
@@ -229,7 +230,8 @@ void SharedMemory::Close() {
Unmap();
if (mapped_file_ > 0) {
- close(mapped_file_);
+ if (HANDLE_EINTR(close(mapped_file_)) < 0)
+ PLOG(ERROR) << "close";
mapped_file_ = -1;
}
}