runtime-rs: open stdout and stderr fifos NONBLOCK

This patch adds O_NONBLOCK flag when open stdout and stderr FIFOs
to avoid blocking.

Fixes: #6714
Signed-off-by: Zixuan Tan <tanzixuan.me@gmail.com>
This commit is contained in:
Zixuan Tan 2023-11-14 18:05:17 +08:00
parent 3eb4bed957
commit 89be42a177

View File

@ -98,6 +98,7 @@ impl PassfdIo {
if let Some(stdout) = &self.stdout {
let fout = OpenOptions::new()
.write(true)
.custom_flags(libc::O_NONBLOCK)
.open(&stdout)
.context("open stdout")?;
@ -113,6 +114,7 @@ impl PassfdIo {
if let Some(stderr) = &self.stderr {
let ferr = OpenOptions::new()
.write(true)
.custom_flags(libc::O_NONBLOCK)
.open(&stderr)
.context("open stderr")?;