qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r1424607 - /qpid/trunk/qpid/cpp/src/qpid/sys/ssl/util.cpp
Date Thu, 20 Dec 2012 17:48:40 GMT
Author: astitcher
Date: Thu Dec 20 17:48:39 2012
New Revision: 1424607

URL: http://svn.apache.org/viewvc?rev=1424607&view=rev
Log:
NO-JIRA: Stop using boost::filesystem for something that std::fstream can do well enough

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/ssl/util.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/ssl/util.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/ssl/util.cpp?rev=1424607&r1=1424606&r2=1424607&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/ssl/util.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/ssl/util.cpp Thu Dec 20 17:48:39 2012
@@ -31,8 +31,6 @@
 
 #include <iostream>
 #include <fstream>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
 
 namespace qpid {
 namespace sys {
@@ -82,15 +80,14 @@ SslOptions SslOptions::global;
 char* readPasswordFromFile(PK11SlotInfo*, PRBool retry, void*)
 {
     const std::string& passwordFile = SslOptions::global.certPasswordFile;
-    if (retry || passwordFile.empty() || !boost::filesystem::exists(passwordFile)) {
-        return 0;
-    } else {
-        std::ifstream file(passwordFile.c_str());
-        std::string password;
-        file >> password;
-        return PL_strdup(password.c_str());
-    }
-}    
+    if (retry || passwordFile.empty()) return 0;
+    std::ifstream file(passwordFile.c_str());
+    if (!file) return 0;
+
+    std::string password;
+    file >> password;
+    return PL_strdup(password.c_str());
+}
 
 void initNSS(const SslOptions& options, bool server)
 {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message