summaryrefslogtreecommitdiff
path: root/src/lib/grok/messenger.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-24 17:23:57 +0200
committerCarl Hetherington <cth@carlh.net>2024-01-28 02:01:57 +0100
commit9aca7d85aa86a9232a2cd83e867d679c30487059 (patch)
tree0161617f7c7a3b3b7164eb8e905d89f7d9bbb009 /src/lib/grok/messenger.h
parent3b1ee8690b21ddc5ff53ba3b2ba50270e3c9f9bf (diff)
Use boost::filesystem::path for gpu_binary_location().
Diffstat (limited to 'src/lib/grok/messenger.h')
-rw-r--r--src/lib/grok/messenger.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/lib/grok/messenger.h b/src/lib/grok/messenger.h
index 008e58dd2..5cb21a1cd 100644
--- a/src/lib/grok/messenger.h
+++ b/src/lib/grok/messenger.h
@@ -542,11 +542,22 @@ struct Messenger
sendQueue.push(oss.str());
}
- void launchGrok(const std::string &dir, uint32_t width, uint32_t stride,
- uint32_t height, uint32_t samplesPerPixel, uint32_t depth,
- int device, bool is4K, uint32_t fps, uint32_t bandwidth,
- const std::string server, uint32_t port,
- const std::string license)
+
+ void launchGrok(
+ boost::filesystem::path const& dir,
+ uint32_t width,
+ uint32_t stride,
+ uint32_t height,
+ uint32_t samplesPerPixel,
+ uint32_t depth,
+ int device,
+ bool is4K,
+ uint32_t fps,
+ uint32_t bandwidth,
+ const std::string server,
+ uint32_t port,
+ const std::string license
+ )
{
std::unique_lock<std::mutex> lk(shutdownMutex_);
@@ -640,13 +651,14 @@ struct Messenger
protected:
std::condition_variable clientInitializedCondition_;
private:
- void launch(const std::string &cmd, const std::string &dir)
+ void launch(std::string const& cmd, boost::filesystem::path const& dir)
{
// Change the working directory
if(!dir.empty())
{
- if(chdir(dir.c_str()) != 0)
- {
+ boost::system::error_code ec;
+ boost::filesystem::current_path(dir, ec);
+ if (ec) {
getMessengerLogger()->error("Error: failed to change the working directory");
return;
}