Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82803 - trunk/boost/interprocess
From: igaztanaga_at_[hidden]
Date: 2013-02-10 06:20:47


Author: igaztanaga
Date: 2013-02-10 06:20:47 EST (Sun, 10 Feb 2013)
New Revision: 82803
URL: http://svn.boost.org/trac/boost/changeset/82803

Log:
Fixes #7928
Text files modified:
   trunk/boost/interprocess/shared_memory_object.hpp | 3 +--
   1 files changed, 1 insertions(+), 2 deletions(-)

Modified: trunk/boost/interprocess/shared_memory_object.hpp
==============================================================================
--- trunk/boost/interprocess/shared_memory_object.hpp (original)
+++ trunk/boost/interprocess/shared_memory_object.hpp 2013-02-10 06:20:47 EST (Sun, 10 Feb 2013)
@@ -320,12 +320,11 @@
       break;
       case ipcdetail::DoOpenOrCreate:
       {
- oflag |= (O_CREAT | O_EXCL);
          //We need a create/open loop to change permissions correctly using fchmod, since
          //with "O_CREAT" only we don't know if we've created or opened the shm.
          while(1){
             //Try to create shared memory
- m_handle = shm_open(m_filename.c_str(), oflag, unix_perm);
+ m_handle = shm_open(m_filename.c_str(), oflag | (O_CREAT | O_EXCL), unix_perm);
             //If successful change real permissions
             if(m_handle >= 0){
                ::fchmod(m_handle, unix_perm);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk