From 9261c1f23265fa1e25ffd46581b427f85bedf474 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 10 Nov 2021 12:26:31 -0500 Subject: bump deps --- src/command.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') 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(()) }; -- cgit v1.2.3-54-g00ecf