Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
doy committed Dec 3, 2023
1 parent 1007cac commit b5d2d6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ impl Pty {
/// unable to put it into non-blocking mode.
pub fn new() -> crate::Result<Self> {
let pty = crate::sys::Pty::open()?;
pty.set_nonblocking()?;
Ok(Self(tokio::io::unix::AsyncFd::new(pty)?))
}

Expand All @@ -35,7 +34,9 @@ impl Pty {
/// Returns an error if the device node to open could not be determined,
/// or if the device node could not be opened.
pub fn pts(&self) -> crate::Result<Pts> {
Ok(Pts(self.0.get_ref().pts()?))
let pts = Pts(self.0.get_ref().pts()?);
self.0.get_ref().set_nonblocking()?;
Ok(pts)
}

/// Splits a `Pty` into a read half and a write half, which can be used to
Expand Down

0 comments on commit b5d2d6a

Please sign in to comment.