summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-12-03 20:11:11 +0000
committerAlan Conway <aconway@apache.org>2009-12-03 20:11:11 +0000
commit9d5667f57e671114f66d64f8b7c4a3cf2f9b0c04 (patch)
treeb076b9bbd1005215979fc6a78a7756244422b1e6 /qpid/cpp/src
parentf1774c6a8986d64c30aa918e3a54c859542afd5e (diff)
downloadqpid-python-9d5667f57e671114f66d64f8b7c4a3cf2f9b0c04.tar.gz
QPID-2231: Cluster + store fails with default data-directory
A broker started with cluster and store enabled and using the Unix default data-directory "$HOME/.qpidd" fails with: Daemon startup failed: boost::filesystem::path: invalid name ".qpidd" in path: "/home/remote/aconway/.qpidd" It would also fail for any user-selected directory name that does not conform to boost "portable filename" syntax. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@886899 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/cluster/StoreStatus.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/qpid/cpp/src/qpid/cluster/StoreStatus.cpp b/qpid/cpp/src/qpid/cluster/StoreStatus.cpp
index 72e4891566..6e412c23f7 100644
--- a/qpid/cpp/src/qpid/cluster/StoreStatus.cpp
+++ b/qpid/cpp/src/qpid/cluster/StoreStatus.cpp
@@ -30,7 +30,7 @@ namespace cluster {
using framing::Uuid;
using namespace framing::cluster;
-using namespace boost::filesystem;
+namespace fs=boost::filesystem;
using std::ostream;
StoreStatus::StoreStatus(const std::string& d)
@@ -43,17 +43,17 @@ const char* SUBDIR="cluster";
const char* CLUSTER_ID_FILE="cluster.uuid";
const char* SHUTDOWN_ID_FILE="shutdown.uuid";
-Uuid loadUuid(const path& path) {
+Uuid loadUuid(const fs::path& path) {
Uuid ret;
if (exists(path)) {
- ifstream i(path);
+ fs::ifstream i(path);
i >> ret;
}
return ret;
}
-void saveUuid(const path& path, const Uuid& uuid) {
- ofstream o(path);
+void saveUuid(const fs::path& path, const Uuid& uuid) {
+ fs::ofstream o(path);
o << uuid;
}
@@ -61,7 +61,7 @@ void saveUuid(const path& path, const Uuid& uuid) {
void StoreStatus::load() {
- path dir = path(dataDir)/SUBDIR;
+ fs::path dir = fs::path(dataDir, fs::native)/SUBDIR;
create_directory(dir);
clusterId = loadUuid(dir/CLUSTER_ID_FILE);
shutdownId = loadUuid(dir/SHUTDOWN_ID_FILE);
@@ -72,7 +72,7 @@ void StoreStatus::load() {
}
void StoreStatus::save() {
- path dir = path(dataDir)/SUBDIR;
+ fs::path dir = fs::path(dataDir, fs::native)/SUBDIR;
create_directory(dir);
saveUuid(dir/CLUSTER_ID_FILE, clusterId);
saveUuid(dir/SHUTDOWN_ID_FILE, shutdownId);