Skip to content

Commit

Permalink
use the RawFd trait to check if the file descriptor terminal (#21)
Browse files Browse the repository at this point in the history
RusytHermit is a library operating system, which is completely
written in Rust. It provides unix-like file descriptors. To check,
if a file descriptor is an terminal, the trait RawFD is used.
  • Loading branch information
stlankes authored Mar 18, 2023
1 parent e161898 commit 2a48188
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
use io_lifetimes::AsFilelike;
#[cfg(windows)]
use io_lifetimes::BorrowedHandle;
#[cfg(target_os = "hermit")]
use std::os::hermit::io::AsRawFd;
#[cfg(windows)]
use std::os::windows::io::AsRawHandle;
#[cfg(windows)]
Expand Down Expand Up @@ -62,7 +64,7 @@ impl<Stream: AsFilelike> IsTerminal for Stream {

#[cfg(target_os = "hermit")]
{
hermit_abi::isatty(self.as_filelike().as_fd())
hermit_abi::isatty(self.as_filelike().as_raw_fd())
}

#[cfg(windows)]
Expand Down

0 comments on commit 2a48188

Please sign in to comment.