mikros: Make stdio inheriting the default on process spawn

This commit is contained in:
pjht 2024-11-08 12:19:04 -06:00
parent 7a029c4a0a
commit 05d2060582
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -107,23 +107,20 @@ pub fn spawn(
_needs_stdin: bool,
) -> io::Result<(Process, StdioPipes)> {
let stdin = match self.stdin.take() {
None => None,
Some(Stdio::Null) => None,
Some(Stdio::Inherit) => *STDIN_FD.get().unwrap(),
None | Some(Stdio::Inherit) => *STDIN_FD.get().unwrap(),
Some(Stdio::MakePipe) => todo!(),
Some(Stdio::InheritFile(file)) => Some((file.fs_pid, file.fd)),
};
let stdout = match self.stdout.take() {
None => None,
Some(Stdio::Null) => None,
Some(Stdio::Inherit) => *STDOUT_FD.get().unwrap(),
None | Some(Stdio::Inherit) => *STDOUT_FD.get().unwrap(),
Some(Stdio::MakePipe) => todo!(),
Some(Stdio::InheritFile(file)) => Some((file.fs_pid, file.fd)),
};
let stderr = match self.stderr.take() {
None => None,
Some(Stdio::Null) => None,
Some(Stdio::Inherit) => *STDERR_FD.get().unwrap(),
None | Some(Stdio::Inherit) => *STDERR_FD.get().unwrap(),
Some(Stdio::MakePipe) => todo!(),
Some(Stdio::InheritFile(file)) => Some((file.fs_pid, file.fd)),
};