Fix Redox `get_tty` by adding `env` import (#40)

This commit is contained in:
Jeremy Soller 2016-07-30 03:48:27 -06:00 committed by ticki
parent 7e3ed4ec93
commit f9928bd6fe
1 changed files with 1 additions and 0 deletions

View File

@ -20,6 +20,7 @@ pub fn is_tty<T: AsRawFd>(_stream: T) -> bool {
/// This allows for getting stdio representing _only_ the TTY, and not other streams.
#[cfg(target_os = "redox")]
pub fn get_tty() -> io::Result<fs::File> {
use std::env;
fs::OpenOptions::new().read(true).write(true).open(try!(env::var("TTY")))
}