File openSUSE_12.2_build.patch of Package xtreemfs-1.3.1

diff -uNpr -x .svn pre-patch/cpp/include/libxtreemfs/user_mapping.h patched/cpp/include/libxtreemfs/user_mapping.h
--- pre-patch/cpp/include/libxtreemfs/user_mapping.h	2012-09-18 13:42:22.066000689 +0200
+++ patched/cpp/include/libxtreemfs/user_mapping.h	2012-09-18 14:22:18.159999949 +0200
@@ -8,6 +8,8 @@
 #ifndef CPP_INCLUDE_LIBXTREEMFS_USER_MAPPING_H_
 #define CPP_INCLUDE_LIBXTREEMFS_USER_MAPPING_H_
 
+#include <sys/types.h>
+
 #include <list>
 #include <string>
 
diff -uNpr -x .svn pre-patch/cpp/src/rpc/client.cpp patched/cpp/src/rpc/client.cpp
--- pre-patch/cpp/src/rpc/client.cpp	2012-09-18 13:42:22.067000637 +0200
+++ patched/cpp/src/rpc/client.cpp	2012-05-07 14:48:26.000000000 +0200
@@ -42,6 +42,12 @@ using namespace std;
 using namespace boost;
 using namespace google::protobuf;
 
+#if (BOOST_VERSION < 104800)
+using boost::interprocess::detail::atomic_inc32;
+#else
+using boost::interprocess::ipcdetail::atomic_inc32;
+#endif  // BOOST_VERSION < 104800
+
 Client::Client(int32_t connect_timeout_s,
                int32_t request_timeout_s,
                int32_t max_con_linger,
@@ -60,7 +66,9 @@ Client::Client(int32_t connect_timeout_s
       certFileName(NULL) {
   // Check if ssl options were passed.
   if (options != NULL) {
-    Logging::log->getLog(LEVEL_INFO) << "SSL support activated" << endl;
+    if (Logging::log->loggingActive(LEVEL_INFO)) {
+      Logging::log->getLog(LEVEL_INFO) << "SSL support activated." << endl;
+    }
 
     use_gridssl_ = options->use_grid_ssl();
     ssl_context_ =
@@ -79,8 +87,10 @@ Client::Client(int32_t connect_timeout_s
     // afterwards the pem- and cert-files are written to temporary files on disk
     // these can be accessed by boost::assio::ssl
     if (!options->pkcs12_file_name().empty()) {
-      Logging::log->getLog(LEVEL_INFO) << "SSL suport using pkcs12 file "
-          << options->pkcs12_file_name() << endl;
+      if (Logging::log->loggingActive(LEVEL_INFO)) {
+        Logging::log->getLog(LEVEL_INFO) << "SSL support using PKCS#12 file "
+            << options->pkcs12_file_name() << endl;
+      }
 
       char tmplate1[] = "/tmp/pmXXXXXX";
       char tmplate2[] = "/tmp/ctXXXXXX";
@@ -90,7 +100,7 @@ Client::Client(int32_t connect_timeout_s
 
       // read the pkcs12 file
       if (!p12_file) {
-        Logging::log->getLog(LEVEL_ERROR) << "Error opening pkcs12 file:"
+        Logging::log->getLog(LEVEL_ERROR) << "Error opening PKCS#12 file: "
             << options->pkcs12_file_name() << ". (file not found)" << endl;
         //TODO(mberlin): Use a better approach than exit - throw?
         exit(1);
@@ -99,7 +109,7 @@ Client::Client(int32_t connect_timeout_s
       fclose(p12_file);
 
       if (!p12) {
-        Logging::log->getLog(LEVEL_ERROR) << "Error reading pkcs12 file:"
+        Logging::log->getLog(LEVEL_ERROR) << "Error reading PKCS#12 file: "
             << options->pkcs12_file_name() << ". (no access rights?)" << endl;
         ERR_print_errors_fp(stderr);
         //TODO(mberlin): Use a better approach than exit - throw?
@@ -116,8 +126,10 @@ Client::Client(int32_t connect_timeout_s
                         &pkey,
                         &cert,
                         &ca)) {
-        Logging::log->getLog(LEVEL_ERROR) << "Error parsing pkcs12 file:"
-            << options->pkcs12_file_name() << endl;
+        Logging::log->getLog(LEVEL_ERROR) << "Error parsing PKCS#12 file: "
+            << options->pkcs12_file_name()
+            << " Please check if the supplied certificate password is correct."
+            << endl;
         ERR_print_errors_fp(stderr);
         //TODO(mberlin): Use a better approach than exit - throw?
         exit(1);
@@ -128,9 +140,9 @@ Client::Client(int32_t connect_timeout_s
       // these which be deleted when exiting the program
 #ifdef WIN32
       //  Gets the temp path env string (no guarantee it's a valid path).
-      TCHAR temp_path[MAX_PATH];
-      TCHAR filename_temp_pem[MAX_PATH];  
-      TCHAR filename_temp_cert[MAX_PATH];  
+      TCHAR temp_path[MAX_PATH];
+      TCHAR filename_temp_pem[MAX_PATH];  
+      TCHAR filename_temp_cert[MAX_PATH];  
 
       DWORD dwRetVal = 0;
       dwRetVal = GetTempPath(MAX_PATH,          // length of the buffer
@@ -213,8 +225,10 @@ Client::Client(int32_t connect_timeout_s
       // FIXME(ps) make sure that the temporary files are deleted!
     } else if (!options->pem_file_name().empty()) {
       // otherwise use the pem files
-      Logging::log->getLog(LEVEL_INFO) << "SSL support using key file "
-          << options->pem_file_name() << endl;
+      if (Logging::log->loggingActive(LEVEL_INFO)) {
+        Logging::log->getLog(LEVEL_INFO) << "SSL support using PEM private key"
+            " file " << options->pem_file_name() << endl;
+      }
 
       try {
         ssl_context_->set_password_callback(
@@ -251,8 +265,7 @@ void Client::sendRequest(const string& a
                          Message* response_message,
                          void* context,
                          ClientRequestCallbackInterface *callback) {
-  uint32_t call_id =
-      boost::interprocess::detail::atomic_inc32(&callid_counter_);
+  uint32_t call_id = atomic_inc32(&callid_counter_);
   ClientRequest *rq = new ClientRequest(address,
                                         call_id,
                                         interface_id,
@@ -266,7 +279,7 @@ void Client::sendRequest(const string& a
                                         context,
                                         callback);
 
-  mutex::scoped_lock lock(this->requests_lock_);
+  boost::mutex::scoped_lock lock(this->requests_lock_);
   bool wasEmpty = requests_.empty();
   requests_.push(rq);
   if (wasEmpty) {
@@ -279,7 +292,7 @@ void Client::sendInternalRequest() {
   do {
     ClientRequest *rq = NULL;
     {
-      mutex::scoped_lock lock(this->requests_lock_);
+      boost::mutex::scoped_lock lock(this->requests_lock_);
       if (requests_.empty())
         break;
       rq = requests_.front();
@@ -416,19 +429,16 @@ void Client::run() {
                                            this,
                                            asio::placeholders::error));
 
-  if (Logging::log->loggingActive(LEVEL_INFO)) {
-    Logging::log->getLog(LEVEL_INFO) << "starting rpc client" << endl;
+  if (Logging::log->loggingActive(LEVEL_DEBUG)) {
+    Logging::log->getLog(LEVEL_DEBUG) << "Starting RPC client." << endl;
     if (ssl_context_ != NULL) {
       if (use_gridssl_) {
-        Logging::log->getLog(LEVEL_INFO) << "running in GRID SSL mode"
-            << endl;
+        Logging::log->getLog(LEVEL_DEBUG) << "Running in GRID SSL mode." << endl;
       } else {
-        Logging::log->getLog(LEVEL_INFO) << "running in SSL mode"
-            << endl;
+        Logging::log->getLog(LEVEL_DEBUG) << "Running in SSL mode." << endl;
       }
     } else {
-      Logging::log->getLog(LEVEL_INFO) << "running in plain TCP mode"
-          << endl;
+      Logging::log->getLog(LEVEL_DEBUG) << "Running in plain TCP mode."<< endl;
     }
   }
 
@@ -445,8 +455,8 @@ void Client::run() {
 
 void Client::shutdown() {
   service_.stop();
-  if (Logging::log->loggingActive(LEVEL_INFO)) {
-    Logging::log->getLog(LEVEL_INFO) << "rpc client stopped" << endl;
+  if (Logging::log->loggingActive(LEVEL_DEBUG)) {
+    Logging::log->getLog(LEVEL_DEBUG) << "RPC client stopped." << endl;
   }
 }
 
openSUSE Build Service is sponsored by