summaryrefslogtreecommitdiffstats
path: root/src/runner/sys.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-02-26 18:08:40 -0500
committerJesse Luehrs <doy@tozt.net>2022-02-26 18:08:40 -0500
commitdfd5ebfa25d799399de0d15cb38ba47f5069647b (patch)
tree262c8b27621507bde8ab292bcd1b1fa04b44ca2f /src/runner/sys.rs
parent07ed5629fff12ccb95216f7b07c91bb6e8bbfbc7 (diff)
downloadnbsh-dfd5ebfa25d799399de0d15cb38ba47f5069647b.tar.gz
nbsh-dfd5ebfa25d799399de0d15cb38ba47f5069647b.zip
reduce typing
Diffstat (limited to 'src/runner/sys.rs')
-rw-r--r--src/runner/sys.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runner/sys.rs b/src/runner/sys.rs
index 413882c..b6a9428 100644
--- a/src/runner/sys.rs
+++ b/src/runner/sys.rs
@@ -2,7 +2,7 @@ use crate::runner::prelude::*;
const PID0: nix::unistd::Pid = nix::unistd::Pid::from_raw(0);
-pub fn pipe() -> anyhow::Result<(std::fs::File, std::fs::File)> {
+pub fn pipe() -> Result<(std::fs::File, std::fs::File)> {
let (r, w) = nix::unistd::pipe2(nix::fcntl::OFlag::O_CLOEXEC)?;
// Safety: these file descriptors were just returned by pipe2 above, and
// are only available in this function, so nothing else can be accessing
@@ -12,7 +12,7 @@ pub fn pipe() -> anyhow::Result<(std::fs::File, std::fs::File)> {
}))
}
-pub fn set_foreground_pg(pg: nix::unistd::Pid) -> anyhow::Result<()> {
+pub fn set_foreground_pg(pg: nix::unistd::Pid) -> Result<()> {
let pty = nix::fcntl::open(
"/dev/tty",
nix::fcntl::OFlag::empty(),
@@ -60,7 +60,7 @@ pub fn setpgid_child(pg: Option<nix::unistd::Pid>) -> std::io::Result<()> {
pub fn setpgid_parent(
pid: nix::unistd::Pid,
pg: Option<nix::unistd::Pid>,
-) -> anyhow::Result<()> {
+) -> Result<()> {
nix::unistd::setpgid(pid, pg.unwrap_or(PID0))
// the child already called exec, so it must have already called
// setpgid itself