process_wrap/tokio/
reset_sigmask.rs1use std::io::Result;
2
3use nix::sys::signal::{SigSet, SigmaskHow, sigprocmask};
4use tokio::process::Command;
5
6use super::{CommandWrap, CommandWrapper};
7
8#[derive(Clone, Copy, Debug)]
13pub struct ResetSigmask;
14
15impl CommandWrapper for ResetSigmask {
16 fn pre_spawn(&mut self, command: &mut Command, _core: &CommandWrap) -> Result<()> {
17 unsafe {
18 command.pre_exec(|| {
19 let newset = SigSet::all();
20 sigprocmask(SigmaskHow::SIG_UNBLOCK, Some(&newset), None)?;
21 Ok(())
22 });
23 }
24 Ok(())
25 }
26}