diff --git a/src/plugin/host-process.cpp b/src/plugin/host-process.cpp index e8c3745c..32cf8c82 100644 --- a/src/plugin/host-process.cpp +++ b/src/plugin/host-process.cpp @@ -45,7 +45,10 @@ bp::child launch_host(fs::path host_path, Args&&... args) { #else host_path, #endif - std::forward(args)...); + // We'll use vfork() instead of fork to avoid potential issues with + // inheriting file descriptors + // https://github.com/robbert-vdh/yabridge/issues/45 + bp::posix::use_vfork, std::forward(args)...); } HostProcess::HostProcess(boost::asio::io_context& io_context, Logger& logger) diff --git a/src/plugin/host-process.h b/src/plugin/host-process.h index 859a8af4..5330adf2 100644 --- a/src/plugin/host-process.h +++ b/src/plugin/host-process.h @@ -16,6 +16,9 @@ #pragma once +// Bosot.Process's auto detection for vfork() support doesn't seem to work +#define BOOST_POSIX_HAS_VFORK 1 + #include #include #include