aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.rs')
-rw-r--r--src/command.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/command.rs b/src/command.rs
index bbfc1e8..ef156aa 100644
--- a/src/command.rs
+++ b/src/command.rs
@@ -96,11 +96,8 @@ impl Command {
}
pub fn spawn(&mut self, pty: crate::Pty) -> crate::Result<Child> {
- let (stdin, stdout, stderr, pre_exec) = crate::sys::setup_subprocess(
- &pty,
- pty.pts().map_err(crate::error::spawn)?,
- )
- .map_err(crate::error::spawn)?;
+ let (stdin, stdout, stderr, pre_exec) =
+ crate::sys::setup_subprocess(&pty, pty.pts()?)?;
self.inner.stdin(self.stdin.take().unwrap_or(stdin));
self.inner.stdout(self.stdout.take().unwrap_or(stdout));
@@ -111,7 +108,7 @@ impl Command {
// async-signal-safe).
unsafe { self.inner.pre_exec(pre_exec) };
- let child = self.inner.spawn().map_err(crate::error::spawn)?;
+ let child = self.inner.spawn()?;
Ok(Child::new(child, pty))
}