aboutsummaryrefslogtreecommitdiffstats
path: root/src/pty.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-14 18:11:04 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-14 18:12:21 -0500
commit38070766d15c44c3d731aa5b231e3b2ad698ac05 (patch)
tree9ea168b1ae5a6e5c0818eb058c342e79a8482c8a /src/pty.rs
parentae7718447d24ea0517e7154873c2b55fdd89538d (diff)
downloadpty-process-38070766d15c44c3d731aa5b231e3b2ad698ac05.tar.gz
pty-process-38070766d15c44c3d731aa5b231e3b2ad698ac05.zip
simplify error handling a bunch
Diffstat (limited to 'src/pty.rs')
-rw-r--r--src/pty.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pty.rs b/src/pty.rs
index fde86b1..a569f88 100644
--- a/src/pty.rs
+++ b/src/pty.rs
@@ -75,12 +75,12 @@ fn create_pt(
let pt = nix::pty::posix_openpt(
nix::fcntl::OFlag::O_RDWR | nix::fcntl::OFlag::O_NOCTTY,
)
- .map_err(crate::error::Error::CreatePty)?;
- nix::pty::grantpt(&pt).map_err(crate::error::Error::CreatePty)?;
- nix::pty::unlockpt(&pt).map_err(crate::error::Error::CreatePty)?;
+ .map_err(crate::error::create_pty)?;
+ nix::pty::grantpt(&pt).map_err(crate::error::create_pty)?;
+ nix::pty::unlockpt(&pt).map_err(crate::error::create_pty)?;
let ptsname = nix::pty::ptsname_r(&pt)
- .map_err(crate::error::Error::CreatePty)?
+ .map_err(crate::error::create_pty)?
.into();
let pt_fd = pt.into_raw_fd();