diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-11-05 21:36:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-11-06 19:49:14 +0100 |
| commit | 99cb06de7d7dde4c558d69bbce5fe09090bada27 (patch) | |
| tree | 2524c646ce6a1e2b7324eb84e646eb972d60c32e | |
| parent | d1addc203597a892c02bd162585c6a55950ffaf5 (diff) | |
Rename a variable and add some logging to start_tool on macOS.
| -rw-r--r-- | src/lib/cross_osx.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index a4888d114..7817348e2 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -208,20 +208,23 @@ Waker::~Waker () void start_tool (string executable, string app) { - boost::filesystem::path batch = directory_containing_executable(); - batch = batch.parent_path (); // MacOS - batch = batch.parent_path (); // Contents - batch = batch.parent_path (); // DCP-o-matic.app - batch = batch.parent_path (); // Applications - batch /= app; - batch /= "Contents"; - batch /= "MacOS"; - batch /= executable; + boost::filesystem::path exe_path = directory_containing_executable(); + exe_path = exe_path.parent_path (); // MacOS + exe_path = exe_path.parent_path (); // Contents + exe_path = exe_path.parent_path (); // DCP-o-matic.app + exe_path = exe_path.parent_path (); // Applications + exe_path /= app; + exe_path /= "Contents"; + exe_path /= "MacOS"; + exe_path /= executable; pid_t pid = fork (); if (pid == 0) { - int const r = system (batch.string().c_str()); + LOG_GENERAL ("start_tool %1 %2 with path %3", executable, app, exe_path.string()); + int const r = system (exe_path.string().c_str()); exit (WEXITSTATUS (r)); + } else if (pid == -1) { + LOG_ERROR_NC("Fork failed in start_tool"); } } |
