From f79b0fd14608375835e9735acbdaa8e4aa32dfb2 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 14 Apr 2022 18:43:22 +0200 Subject: [PATCH] Fix Process file redirection --- src/common/process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/process.cpp b/src/common/process.cpp index 0e8c1f30..d8d79510 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -337,9 +337,9 @@ Process::HandleResult Process::spawn_child_redirected( posix_spawn_file_actions_t actions; posix_spawn_file_actions_init(&actions); posix_spawn_file_actions_addopen(&actions, STDOUT_FILENO, filename.c_str(), - O_WRONLY | O_APPEND, 0); + O_WRONLY | O_CREAT | O_APPEND, 0640); posix_spawn_file_actions_addopen(&actions, STDERR_FILENO, filename.c_str(), - O_WRONLY | O_APPEND, 0); + O_WRONLY | O_CREAT | O_APPEND, 0640); // See the note in the other function #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34)