Skip to content

Commit efca399

Browse files
committed
Fix incorrect stdio ctors on Unix
1 parent e5cb103 commit efca399

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/wasi-common/src/sys/unix/stdio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ impl StdioExt for Stdio {
2626
Ok(Box::new(Self::In { rights }))
2727
}
2828
fn stdout() -> io::Result<Box<dyn Handle>> {
29-
let file = unsafe { File::from_raw_fd(io::stdin().as_raw_fd()) };
29+
let file = unsafe { File::from_raw_fd(io::stdout().as_raw_fd()) };
3030
let file = ManuallyDrop::new(file);
3131
let rights = get_rights(&file)?;
3232
let rights = Cell::new(rights);
3333
Ok(Box::new(Self::Out { rights }))
3434
}
3535
fn stderr() -> io::Result<Box<dyn Handle>> {
36-
let file = unsafe { File::from_raw_fd(io::stdin().as_raw_fd()) };
36+
let file = unsafe { File::from_raw_fd(io::stderr().as_raw_fd()) };
3737
let file = ManuallyDrop::new(file);
3838
let rights = get_rights(&file)?;
3939
let rights = Cell::new(rights);

0 commit comments

Comments
 (0)