diff --git a/crates/wasi-common/src/sys/unix/stdio.rs b/crates/wasi-common/src/sys/unix/stdio.rs index 8e8dc847107a..63bae9c73e59 100644 --- a/crates/wasi-common/src/sys/unix/stdio.rs +++ b/crates/wasi-common/src/sys/unix/stdio.rs @@ -26,14 +26,14 @@ impl StdioExt for Stdio { Ok(Box::new(Self::In { rights })) } fn stdout() -> io::Result> { - let file = unsafe { File::from_raw_fd(io::stdin().as_raw_fd()) }; + let file = unsafe { File::from_raw_fd(io::stdout().as_raw_fd()) }; let file = ManuallyDrop::new(file); let rights = get_rights(&file)?; let rights = Cell::new(rights); Ok(Box::new(Self::Out { rights })) } fn stderr() -> io::Result> { - let file = unsafe { File::from_raw_fd(io::stdin().as_raw_fd()) }; + let file = unsafe { File::from_raw_fd(io::stderr().as_raw_fd()) }; let file = ManuallyDrop::new(file); let rights = get_rights(&file)?; let rights = Cell::new(rights);