From efca399a0032afa0ec6d2e284d04837e3664f70c Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Sat, 2 May 2020 09:10:51 +0200 Subject: [PATCH] Fix incorrect stdio ctors on Unix --- crates/wasi-common/src/sys/unix/stdio.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);