From c8a4a0d67ca601e3b43bf1555303eb521f9689f5 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 12 Jan 2017 19:13:38 -0700 Subject: [PATCH] Mistake in init using wrong fd in dup2, update userutils --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9c4c4d422f..d4c3ebd04d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,8 +15,8 @@ fn switch_stdio(stdio: &str) -> Result<()> { let stderr = OpenOptions::new().write(true).open(stdio)?; syscall::dup2(stdin.as_raw_fd(), 0, &[]).map_err(|err| Error::from_raw_os_error(err.errno))?; - syscall::dup2(stdout.as_raw_fd(), 0, &[]).map_err(|err| Error::from_raw_os_error(err.errno))?; - syscall::dup2(stderr.as_raw_fd(), 0, &[]).map_err(|err| Error::from_raw_os_error(err.errno))?; + syscall::dup2(stdout.as_raw_fd(), 1, &[]).map_err(|err| Error::from_raw_os_error(err.errno))?; + syscall::dup2(stderr.as_raw_fd(), 2, &[]).map_err(|err| Error::from_raw_os_error(err.errno))?; Ok(()) }