Update tty.rs

This commit is contained in:
Jeremy Soller 2017-07-27 07:00:48 -06:00 committed by GitHub
parent bc33fe1420
commit da9a604c40
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
use std::{fs, io}; use std::{fs, io};
use std::os::unix::io::AsRawFd; use std::os::unix::io::AsRawFd;
/// Is this stream an TTY? /// Is this stream a TTY?
#[cfg(not(target_os = "redox"))] #[cfg(not(target_os = "redox"))]
pub fn is_tty<T: AsRawFd>(stream: &T) -> bool { pub fn is_tty<T: AsRawFd>(stream: &T) -> bool {
use libc; use libc;
@ -9,7 +9,7 @@ pub fn is_tty<T: AsRawFd>(stream: &T) -> bool {
unsafe { libc::isatty(stream.as_raw_fd()) == 1 } unsafe { libc::isatty(stream.as_raw_fd()) == 1 }
} }
/// This will panic. /// Is this stream a TTY?
#[cfg(target_os = "redox")] #[cfg(target_os = "redox")]
pub fn is_tty<T: AsRawFd>(stream: &T) -> bool { pub fn is_tty<T: AsRawFd>(stream: &T) -> bool {
use syscall; use syscall;