qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmora...@apache.org
Subject svn commit: r1559090 - /qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp
Date Fri, 17 Jan 2014 12:32:30 GMT
Author: pmoravec
Date: Fri Jan 17 12:32:29 2014
New Revision: 1559090

URL: http://svn.apache.org/r1559090
Log:
QPID-5486: Creating paged queue can overwrite existing qpidd files

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp?rev=1559090&r1=1559089&r2=1559090&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp Fri Jan 17 12:32:29 2014
@@ -65,8 +65,7 @@ std::string MemoryMappedFile::open(const
 {
     std::string path = getFileName(name, directory);
 
-    if (access(path.c_str(), F_OK) != -1) throw qpid::Exception(QPID_MSG("Attempting to re-write
file " << path << " for paged queue \"" << name << "\""));
-    int flags = O_CREAT | O_TRUNC | O_RDWR;
+    int flags = O_CREAT | O_EXCL | O_RDWR;
     int fd = ::open(path.c_str(), flags, S_IRUSR | S_IWUSR);
     if (fd == -1) throw qpid::Exception(QPID_MSG("Failed to open memory mapped file " <<
path << ": " << qpid::sys::strError(errno) << " [flags=" << flags
<< "]"));
     state->fd = fd;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message