You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by pm...@apache.org on 2014/01/16 15:19:40 UTC
svn commit: r1558806 -
/qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp
Author: pmoravec
Date: Thu Jan 16 14:19:39 2014
New Revision: 1558806
URL: http://svn.apache.org/r1558806
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=1558806&r1=1558805&r2=1558806&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp Thu Jan 16 14:19:39 2014
@@ -65,6 +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 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 << "]"));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org