aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-11-10 12:26:31 -0500
committerJesse Luehrs <doy@tozt.net>2021-11-10 12:26:31 -0500
commit9261c1f23265fa1e25ffd46581b427f85bedf474 (patch)
tree62c75c45614dfbd4624c6c934486a37729788c1e /src
parent9d843436ffc583d95beff7660011eabcaf54fb62 (diff)
downloadpty-process-9261c1f23265fa1e25ffd46581b427f85bedf474.tar.gz
pty-process-9261c1f23265fa1e25ffd46581b427f85bedf474.zip
bump deps
Diffstat (limited to 'src')
-rw-r--r--src/command.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/command.rs b/src/command.rs
index ff8a7cf..df5ed62 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -49,9 +49,8 @@ where
self.std_fds(stdin, stdout, stderr);
let pre_exec = move || {
- nix::unistd::setsid().map_err(|e| e.as_errno().unwrap())?;
- set_controlling_terminal(pts_fd)
- .map_err(|e| e.as_errno().unwrap())?;
+ nix::unistd::setsid()?;
+ set_controlling_terminal(pts_fd)?;
// in the parent, destructors will handle closing these file
// descriptors (other than pt, used by the parent to
@@ -59,15 +58,14 @@ where
// the child, we end by calling exec(), which doesn't call
// destructors.
- // XXX unwrap
- nix::unistd::close(pt_fd).map_err(|e| e.as_errno().unwrap())?;
- nix::unistd::close(pts_fd).map_err(|e| e.as_errno().unwrap())?;
+ nix::unistd::close(pt_fd)?;
+ nix::unistd::close(pts_fd)?;
// at this point, stdin/stdout/stderr have already been
// reopened as fds 0/1/2 in the child, so we can (and should)
// close the originals
- nix::unistd::close(stdin).map_err(|e| e.as_errno().unwrap())?;
- nix::unistd::close(stdout).map_err(|e| e.as_errno().unwrap())?;
- nix::unistd::close(stderr).map_err(|e| e.as_errno().unwrap())?;
+ nix::unistd::close(stdin)?;
+ nix::unistd::close(stdout)?;
+ nix::unistd::close(stderr)?;
Ok(())
};