diff --git a/crates/oyster_runtime/src/pipeline.rs b/crates/oyster_runtime/src/pipeline.rs index f2ec863..5ee036b 100644 --- a/crates/oyster_runtime/src/pipeline.rs +++ b/crates/oyster_runtime/src/pipeline.rs @@ -65,23 +65,16 @@ impl<'a> PreparedCommand<'a> { cmd.stderr(self.stderr.map_or(Stdio::inherit(), Stdio::from)); cmd.process_group(pgid.as_raw()); - { - let pgid = *pgid; - unsafe { - cmd.pre_exec(move || { - if pgid == Pid::from_raw(0) { - let _ = unistd::tcsetpgrp(libc::STDIN_FILENO, unistd::getpid()); - } + unsafe { + cmd.pre_exec(move || { + let _ = unistd::tcsetpgrp(libc::STDIN_FILENO, unistd::getpid()); - let default = - SigAction::new(SigHandler::SigDfl, SaFlags::empty(), SigSet::empty()); + let default = SigAction::new(SigHandler::SigDfl, SaFlags::empty(), SigSet::empty()); + let _ = signal::sigaction(signal::Signal::SIGTSTP, &default); + let _ = signal::sigaction(signal::Signal::SIGTTOU, &default); - let _ = signal::sigaction(signal::Signal::SIGTSTP, &default); - let _ = signal::sigaction(signal::Signal::SIGTTOU, &default); - - Ok(()) - }); - } + Ok(()) + }); } let child = match cmd.spawn() {