Allow concurrent child processes

When multiple child processes are running, closing the
stdin of one child did not send EOF or cause POLLNVAL,
as long as a dup()'ed filedes still existed.

This fixes an issue when running an mp3 encoder while the
video monitor is visible, and will allow to concurrently
run multiple mp3 encoders or other child processes.

Previously this caused Ardour to hang indefinitely in CmdPipeWriter
```
 _proc->close_stdin();
 _proc->wait(); // << here
```
This commit is contained in:
Robin Gareus 2023-03-25 06:09:43 +01:00
parent 70df054d68
commit 3715154a8e
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 36 additions and 2 deletions

View file

@ -920,6 +920,7 @@ SystemExec::close_stdin()
if (pin[1] < 0) {
return;
}
fsync (pin[1]);
close_fd (pin[0]);
close_fd (pin[1]);
fsync (pout[0]);