summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-03-05 19:11:10 +0100
committerRobin Gareus <robin@gareus.org>2019-03-05 22:52:53 +0100
commit8b5437301b8510339cce87c0c11c1dc9ec8d92a4 (patch)
treeb3e355d3b7aac841247c3ee2e4d81eeca463d7be /libs/pbd
parenta390d8d3ca9f6e080b790a4d40f1687b498b1ed3 (diff)
Close stderr of child processes on MacOS
This fixes a bug on some modern mac systems. Related to setup_logging() changing stderr to use ASL and write to com.apple.console. When a forked application writes to stderr while ASL is used, the child is terminated for some reason.
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/system_exec.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/pbd/system_exec.cc b/libs/pbd/system_exec.cc
index 23f808a0c3..6be62ef8ef 100644
--- a/libs/pbd/system_exec.cc
+++ b/libs/pbd/system_exec.cc
@@ -897,8 +897,11 @@ SystemExec::start (StdErrMode stderr_mode, const char *vfork_exec_wrapper)
} else if (stderr_mode == IgnoreAndClose) {
/* ignore STDERR */
::close(STDERR_FILENO);
- } else {
+ } else { /* stderr_mode == ShareWithParent */
/* keep STDERR */
+#if defined __APPLE__&& defined ASL_LOG_DESCRIPTOR_WRITE
+ ::close(STDERR_FILENO);
+#endif
}
if (pout[1] != STDOUT_FILENO && pout[1] != STDERR_FILENO) {