summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2009-05-11 22:26:49 +0000
committerStephen D. Huston <shuston@apache.org>2009-05-11 22:26:49 +0000
commit6ac75b539d14c1344cf00a696daec110d9710d00 (patch)
treec0e9cfe56d1ee7ffa03522cae4af7a295eb3ece5 /cpp/src/qpid
parent2be73b1fa71d50ef20d444d0f2bdce9fd90ccc24 (diff)
downloadqpid-python-6ac75b539d14c1344cf00a696daec110d9710d00.tar.gz
Add --quit, --check for Windows; required fixing LockFile for Windows
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@773712 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/framing/Uuid.h3
-rw-r--r--cpp/src/qpid/sys/LockFile.h9
-rwxr-xr-xcpp/src/qpid/sys/windows/LockFile.cpp6
3 files changed, 10 insertions, 8 deletions
diff --git a/cpp/src/qpid/framing/Uuid.h b/cpp/src/qpid/framing/Uuid.h
index fe0c32dc0b..b595a2ff42 100644
--- a/cpp/src/qpid/framing/Uuid.h
+++ b/cpp/src/qpid/framing/Uuid.h
@@ -58,8 +58,9 @@ struct Uuid : public boost::array<uint8_t, 16> {
void clear() { uuid_clear(c_array()); }
/** Test for null (all zeros). */
+ // Force int 0/!0 to false/true; avoids compile warnings.
bool isNull() {
- return uuid_is_null(data());
+ return !!uuid_is_null(data());
}
// Default op= and copy ctor are fine.
diff --git a/cpp/src/qpid/sys/LockFile.h b/cpp/src/qpid/sys/LockFile.h
index 2ff8c2f6d4..71cb5e2f10 100644
--- a/cpp/src/qpid/sys/LockFile.h
+++ b/cpp/src/qpid/sys/LockFile.h
@@ -23,6 +23,7 @@
#include <boost/shared_ptr.hpp>
#include <string>
+#include "qpid/CommonImportExport.h"
#include "IntegerTypes.h"
namespace qpid {
@@ -48,8 +49,8 @@ class LockFile : private boost::noncopyable
bool created;
public:
- LockFile(const std::string& path_, bool create);
- ~LockFile();
+ QPID_COMMON_EXTERN LockFile(const std::string& path_, bool create);
+ QPID_COMMON_EXTERN ~LockFile();
/**
* Read the process ID from the lock file. This method assumes that
@@ -60,7 +61,7 @@ public:
*
* @returns The stored process ID. No validity check is done on it.
*/
- pid_t readPid(void) const;
+ QPID_COMMON_EXTERN pid_t readPid(void) const;
/**
* Write the current process's ID to the lock file. It's written at
@@ -69,7 +70,7 @@ public:
*
* Throws an exception if the write fails.
*/
- void writePid(void);
+ QPID_COMMON_EXTERN void writePid(void);
};
}} /* namespace qpid::sys */
diff --git a/cpp/src/qpid/sys/windows/LockFile.cpp b/cpp/src/qpid/sys/windows/LockFile.cpp
index 9804020167..766fa6466a 100755
--- a/cpp/src/qpid/sys/windows/LockFile.cpp
+++ b/cpp/src/qpid/sys/windows/LockFile.cpp
@@ -37,10 +37,10 @@ LockFile::LockFile(const std::string& path_, bool create)
: path(path_), created(create) {
HANDLE h = CreateFile(path.c_str(),
- GENERIC_READ|GENERIC_WRITE,
- 0, /* Disable opens by any other attempter */
+ create ? (GENERIC_READ|GENERIC_WRITE) : GENERIC_READ,
+ FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
0, /* Default security */
- OPEN_ALWAYS, /* Create if needed */
+ create ? OPEN_ALWAYS : OPEN_EXISTING,
FILE_FLAG_DELETE_ON_CLOSE, /* Delete file when closed */
NULL);
QPID_WINDOWS_CHECK_NOT(h, INVALID_HANDLE_VALUE);