summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-11-02 12:50:10 +0000
committerIain Merrick <husky@google.com>2010-11-03 15:23:03 +0000
commita63d6587a9fe4317d9cd57ab8b7ef9e5951d05fc (patch)
tree664eb2ae4d1b784f179c5aba7bec7e3cdcc858f1
parent82855d1006d8ec9d2190b6ca599820b0ab39e4fc (diff)
downloadexternal_chromium-a63d6587a9fe4317d9cd57ab8b7ef9e5951d05fc.zip
external_chromium-a63d6587a9fe4317d9cd57ab8b7ef9e5951d05fc.tar.gz
external_chromium-a63d6587a9fe4317d9cd57ab8b7ef9e5951d05fc.tar.bz2
Merge Chromium at r63472 : Fix shared_memory_posix.cc
Android is not actually POSIX and doesn't have lockf(). For now, just commenting out these calls. File locking shouldn't be needed as we don't have multiple processes, unlike Chrome. Change-Id: Ia9705562be54a79681176873b2e9910ece6e79d9
-rw-r--r--base/shared_memory_posix.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index 7283cbd..dfd86aa 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -292,6 +292,7 @@ void SharedMemory::Close() {
void SharedMemory::LockOrUnlockCommon(int function) {
DCHECK(mapped_file_ >= 0);
+#if !defined(ANDROID)
while (lockf(mapped_file_, function, 0) < 0) {
if (errno == EINTR) {
continue;
@@ -307,14 +308,19 @@ void SharedMemory::LockOrUnlockCommon(int function) {
<< " msg:" << safe_strerror(errno);
}
}
+#endif
}
void SharedMemory::Lock() {
+#if !defined(ANDROID)
LockOrUnlockCommon(F_LOCK);
+#endif
}
void SharedMemory::Unlock() {
+#if !defined(ANDROID)
LockOrUnlockCommon(F_ULOCK);
+#endif
}
SharedMemoryHandle SharedMemory::handle() const {