Skip to content

Commit d994fef

Browse files
committed
std: sys: process: uefi: Allow specifying Stdin
Stdio::MakePipe is not supported. For Stdio::Null, return UNSUPPORTED. This is treated as read(0). Additionally, have infinte loop on the notify function to prevent wait_for_key from returning. Signed-off-by: Ayush Singh <[email protected]>
1 parent af25995 commit d994fef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

library/std/src/sys/process/uefi.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub struct Command {
2323
args: Vec<OsString>,
2424
stdout: Option<Stdio>,
2525
stderr: Option<Stdio>,
26+
stdin: Option<Stdio>,
2627
env: CommandEnv,
2728
}
2829

@@ -48,6 +49,7 @@ impl Command {
4849
args: Vec::new(),
4950
stdout: None,
5051
stderr: None,
52+
stdin: None,
5153
env: Default::default(),
5254
}
5355
}
@@ -64,8 +66,8 @@ impl Command {
6466
panic!("unsupported")
6567
}
6668

67-
pub fn stdin(&mut self, _stdin: Stdio) {
68-
panic!("unsupported")
69+
pub fn stdin(&mut self, stdin: Stdio) {
70+
self.stdin = Some(stdin);
6971
}
7072

7173
pub fn stdout(&mut self, stdout: Stdio) {
@@ -166,7 +168,8 @@ impl Command {
166168
};
167169

168170
// Setup Stdin
169-
let stdin = Self::create_stdin(Stdio::Null)?;
171+
let stdin = self.stdin.unwrap_or(Stdio::Null);
172+
let stdin = Self::create_stdin(stdin)?;
170173
if let Some(con) = stdin {
171174
cmd.stdin_init(con)
172175
} else {

0 commit comments

Comments
 (0)