aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/StartProcess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Utilities/StartProcess.cpp')
-rw-r--r--src/common/Utilities/StartProcess.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/common/Utilities/StartProcess.cpp b/src/common/Utilities/StartProcess.cpp
index 6f4676232ca..dc25cde3767 100644
--- a/src/common/Utilities/StartProcess.cpp
+++ b/src/common/Utilities/StartProcess.cpp
@@ -16,27 +16,20 @@
*/
#include "StartProcess.h"
-
-#include <atomic>
-#include <thread>
-#include <functional>
+#include "Errors.h"
+#include "Log.h"
+#include "Optional.h"
#include <boost/algorithm/string/join.hpp>
-#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/copy.hpp>
-#include <boost/iostreams/concepts.hpp>
-#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/process.hpp>
-#include <boost/system/system_error.hpp>
-
-#include "Common.h"
-#include "Log.h"
using namespace boost::process;
using namespace boost::process::initializers;
using namespace boost::iostreams;
-namespace Trinity {
+namespace Trinity
+{
template<typename T>
class TCLogSink
@@ -51,7 +44,7 @@ public:
TCLogSink(T callback)
: callback_(std::move(callback)) { }
- std::streamsize write(const char* str, std::streamsize size)
+ std::streamsize write(char const* str, std::streamsize size)
{
callback_(std::string(str, size));
return size;
@@ -250,19 +243,15 @@ std::shared_ptr<AsyncProcessResult>
return handle;
}
-Optional<std::string> SearchExecutableInPath(std::string const& filename)
+std::string SearchExecutableInPath(std::string const& filename)
{
try
{
- auto result = search_path(filename);
- if (result.empty())
- return boost::none;
- else
- return result;
+ return search_path(filename);
}
catch (...)
{
- return boost::none;
+ return "";
}
}