mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Distinguish between active group hosts and zombies
This commit is contained in:
@@ -27,6 +27,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
- Fixed the Wine prefix being overwritten for all subsequent plugins opened
|
- Fixed the Wine prefix being overwritten for all subsequent plugins opened
|
||||||
within the same process. This prevented the use of multiple Wine prefixes
|
within the same process. This prevented the use of multiple Wine prefixes
|
||||||
within hosts that do not sandbox their plugins, such as Ardour.
|
within hosts that do not sandbox their plugins, such as Ardour.
|
||||||
|
- Distinguish between active processes and zombies when checking whether a group
|
||||||
|
host process is still running during initialization.
|
||||||
|
|
||||||
## [1.2.0] - 2020-05-29
|
## [1.2.0] - 2020-05-29
|
||||||
|
|
||||||
|
|||||||
@@ -234,8 +234,17 @@ bool GroupHost::running() {
|
|||||||
// process is still running, however Boost.Process does not allow you to do
|
// process is still running, however Boost.Process does not allow you to do
|
||||||
// the same thing for a process that's not a direct child if this process.
|
// the same thing for a process that's not a direct child if this process.
|
||||||
// When using plugin groups we'll have to manually check whether the PID
|
// When using plugin groups we'll have to manually check whether the PID
|
||||||
// returned by the group host process is still active.
|
// returned by the group host process is still active. We sadly can't use
|
||||||
return kill(host_pid, 0) == 0;
|
// `kill()` for this as that provides no way to distinguish between active
|
||||||
|
// processes and zombies, and a terminated group host process will always be
|
||||||
|
// left as a zombie process. If the process is active, then
|
||||||
|
// `/proc/<pid>/{cwd,exe,root}` will be valid symlinks.
|
||||||
|
try {
|
||||||
|
fs::canonical("/proc/" + std::to_string(host_pid) + "/exe");
|
||||||
|
return true;
|
||||||
|
} catch (const fs::filesystem_error&) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupHost::terminate() {
|
void GroupHost::terminate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user