diff options
author | Gordon Sim <gsim@apache.org> | 2013-04-30 15:46:53 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2013-04-30 15:46:53 +0000 |
commit | 7129063421755d58de23da58daa89c6d81aa1b0b (patch) | |
tree | dcb6798661681321fedede34641ec0888bfcb282 /qpid/cpp/src/qpid/sys/posix | |
parent | 81386a15e0114481f18d973bb01020a81d0d2639 (diff) | |
download | qpid-python-7129063421755d58de23da58daa89c6d81aa1b0b.tar.gz |
QPID-4339: fix for older compilers/c++ libraries
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1477698 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/sys/posix')
-rw-r--r-- | qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp b/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp index eae23cc6a9..147a1970ee 100644 --- a/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp +++ b/qpid/cpp/src/qpid/sys/posix/MemoryMappedFile.cpp @@ -54,10 +54,11 @@ std::string getFileName(const std::string& name, const std::string& dir) class MemoryMappedFilePrivate { friend class MemoryMappedFile; - const int fd; - MemoryMappedFilePrivate(int fd_) : fd(fd_) {} + int fd; + MemoryMappedFilePrivate() : fd(0) {} }; -MemoryMappedFile::MemoryMappedFile() {} +MemoryMappedFile::MemoryMappedFile() : state(new MemoryMappedFilePrivate) {} +MemoryMappedFile::~MemoryMappedFile() { delete state; } std::string MemoryMappedFile::open(const std::string& name, const std::string& directory) { @@ -66,7 +67,7 @@ std::string MemoryMappedFile::open(const std::string& name, const std::string& d int flags = O_CREAT | O_TRUNC | O_RDWR; int fd = ::open(path.c_str(), flags, S_IRWXU); if (fd == -1) throw qpid::Exception(QPID_MSG("Failed to open memory mapped file " << path << ": " << qpid::sys::strError(errno) << " [flags=" << flags << "]")); - state = std::auto_ptr<MemoryMappedFilePrivate>(new MemoryMappedFilePrivate(fd)); + state->fd = fd; return path; } size_t MemoryMappedFile::getPageSize() |