qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r886899 - /qpid/trunk/qpid/cpp/src/qpid/cluster/StoreStatus.cpp
Date Thu, 03 Dec 2009 20:11:12 GMT
Author: aconway
Date: Thu Dec  3 20:11:11 2009
New Revision: 886899

URL: http://svn.apache.org/viewvc?rev=886899&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/cluster/StoreStatus.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/StoreStatus.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/StoreStatus.cpp?rev=886899&r1=886898&r2=886899&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/StoreStatus.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/StoreStatus.cpp Thu Dec  3 20:11:11 2009
@@ -30,7 +30,7 @@
 
 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* 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 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::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);



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message