fix: make child pipe blocking

This commit is contained in:
Quinten 2025-11-11 14:46:34 +01:00
parent 63c24cf6e8
commit 44790957ce

View File

@ -62,6 +62,8 @@ void CgiProcess::spawn()
}
if (pid_ == 0)
{
int flags = fcntl(pipeStdin[0], F_GETFL, 0);
if (flags != -1) {fcntl(pipeStdin[0], F_SETFL, flags & ~O_NONBLOCK);}
dup2(pipeStdin[0], STDIN_FILENO);
dup2(pipeStdout[1], STDOUT_FILENO);
dup2(pipeStderr[1], STDERR_FILENO);