summaryrefslogtreecommitdiffstats
path: root/base/shared_memory_posix.cc
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 15:29:16 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 15:29:16 +0000
commitd137d54c9f90b06bfbbc6dcd7cb9b514b857fdac (patch)
tree250134ffd75ca65ea37419723e54e9dc6ad1bbe5 /base/shared_memory_posix.cc
parent12e742ee34fff97cfb42065d543c984b4178c5d6 (diff)
downloadchromium_src-d137d54c9f90b06bfbbc6dcd7cb9b514b857fdac.zip
chromium_src-d137d54c9f90b06bfbbc6dcd7cb9b514b857fdac.tar.gz
chromium_src-d137d54c9f90b06bfbbc6dcd7cb9b514b857fdac.tar.bz2
ensure that the shared memory has actually been created before trying to re-use it when the |open_existing| flag is passed to Create().
Review URL: http://codereview.chromium.org/4039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/shared_memory_posix.cc')
-rw-r--r--base/shared_memory_posix.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index a177553..82e4f60 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -56,7 +56,7 @@ bool SharedMemory::Create(const std::wstring &name, bool read_only,
int posix_flags = 0;
posix_flags |= read_only ? O_RDONLY : O_RDWR;
- if (!open_existing)
+ if (!open_existing || mapped_file_ <= 0)
posix_flags |= O_CREAT;
if (CreateOrOpen(name, posix_flags)) {