Mistake in init using wrong fd in dup2, update userutils

This commit is contained in:
Jeremy Soller
2017-01-12 19:13:38 -07:00
parent 61ff636174
commit c8a4a0d67c
+2 -2
View File
@@ -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(())
}