From 9261c1f23265fa1e25ffd46581b427f85bedf474 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 10 Nov 2021 12:26:31 -0500 Subject: bump deps --- Cargo.toml | 26 +++++++++++++------------- src/command.rs | 16 +++++++--------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e044317..f038732 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,22 +12,22 @@ categories = ["asynchronous", "command-line-interface"] license = "MIT" [dependencies] -libc = "0.2" -nix = "0.20" -thiserror = "1.0" +libc = "0.2.107" +nix = "0.23.0" +thiserror = "1.0.30" -async-io = { version = "1.3", optional = true } -async-process = { version = "1.0", optional = true } -tokio = { version = "1.2", optional = true, features = ["fs", "process", "net"] } -futures = { version = "0.3", optional = true } +async-io = { version = "1.6.0", optional = true } +async-process = { version = "1.3.0", optional = true } +tokio = { version = "1.13.0", optional = true, features = ["fs", "process", "net"] } +futures = { version = "0.3.17", optional = true } [dev-dependencies] -async-std = { version = "1.9", features = ["unstable"] } -async-executor = "1.4" -regex = "1.4" -smol = "1.2" -term_size = "0.3" -tokio = { version = "1.2", features = [ "rt-multi-thread", "macros", "io-std", "io-util", "time" ] } +async-std = { version = "1.10.0", features = ["unstable"] } +async-executor = "1.4.1" +regex = "1.5.4" +smol = "1.2.5" +term_size = "0.3.2" +tokio = { version = "1.13.0", features = [ "rt-multi-thread", "macros", "io-std", "io-util", "time" ] } [features] default = ["backend-std"] 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