diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2016-02-12 18:22:12 -0600 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2016-02-12 18:22:12 -0600 |
commit | d814acbb8f3b48bc1165b8012da6ed0207ddb086 (patch) | |
tree | 4788cc044fbae6ea1dbf2705048ff5a4c0eb7b88 /libs | |
parent | 0812f3bac19368cee5e2af04a93e50dbc640f9c5 (diff) |
add some debugging capability for users of SystemExec. Needs review.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/export_handler.cc | 6 | ||||
-rw-r--r-- | libs/pbd/pbd/system_exec.h | 2 | ||||
-rw-r--r-- | libs/pbd/system_exec.cc | 12 |
3 files changed, 18 insertions, 2 deletions
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 42de0fa0c6..96e8052bf4 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -355,15 +355,17 @@ ExportHandler::finish_timespan () subs.insert (std::pair<char, std::string> ('n', session.name ())); ARDOUR::SystemExec *se = new ARDOUR::SystemExec(fmt->command(), subs); + info << "Post-export command line : {" << se->GetString() << "}" << endmsg; se->ReadStdout.connect_same_thread(command_connection, boost::bind(&ExportHandler::command_output, this, _1, _2)); - if (se->start (2) == 0) { + int ret = se->start (2); + if (ret == 0) { // successfully started while (se->is_running ()) { // wait for system exec to terminate Glib::usleep (1000); } } else { - error << "post-export hook failed! " << fmt->command() << endmsg; + error << "Post-export command FAILED with Error: " << ret << endmsg; } delete (se); } diff --git a/libs/pbd/pbd/system_exec.h b/libs/pbd/pbd/system_exec.h index b554bdca94..07f7d139a7 100644 --- a/libs/pbd/pbd/system_exec.h +++ b/libs/pbd/pbd/system_exec.h @@ -115,6 +115,8 @@ class LIBPBD_API SystemExec virtual ~SystemExec (); + std::string GetString(); + /** fork and execute the given program * * @param stderr_mode select what to do with program's standard error diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc index 02e4ddcd85..fc66e1f6e4 100644 --- a/libs/pbd/system_exec.cc +++ b/libs/pbd/system_exec.cc @@ -282,6 +282,18 @@ SystemExec::make_argp_escaped(std::string command, const std::map<char, std::str argp[n] = NULL; } +string +SystemExec::GetString () +{ + stringstream out; + if (argp) { + for (int i = 0; argp[i]; ++i) { + out << argp[i]; + } + } + return out.str(); +} + SystemExec::~SystemExec () { terminate (); |