Skip to content

Commit c504096

Browse files
committed
Processing (Linux): fix hanging if a child process prints to both stdout and stderr
1 parent c9ef472 commit c504096

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Bugfixes:
3131
* Detect BSSID instead of Wifi MAC address to align with other platforms (Wifi, macOS)
3232
* Remove support of used GPU memory detection, which is not reliable and only supported with `--gpu-force-vulkan`. (GPU)
3333
* Fix flag `--brightness-ddcci-sleep` (Brightness, Linux)
34+
* Fix hanging if a child process prints to both stdout and stderr (Linux)
3435

3536
Logos:
3637
* Add Black Mesa

src/common/processing_linux.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ const char* ffProcessAppendOutput(FFstrbuf* buffer, char* const argv[], bool use
3434
//Child
3535
if(childPid == 0)
3636
{
37+
int nullFile = open("/dev/null", O_WRONLY);
3738
dup2(pipes[1], useStdErr ? STDERR_FILENO : STDOUT_FILENO);
39+
dup2(nullFile, useStdErr ? STDOUT_FILENO : STDERR_FILENO);
3840
close(pipes[0]);
3941
close(pipes[1]);
40-
close(useStdErr ? STDOUT_FILENO : STDERR_FILENO);
4142
setenv("LANG", "C", 1);
4243
execvp(argv[0], argv);
4344
exit(901);

0 commit comments

Comments
 (0)