mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
parent
b89619330b
commit
4101bb30bf
1 changed files with 10 additions and 24 deletions
|
@ -112,20 +112,10 @@ impl PosixSpawner {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set the handling for job control signals back to the default.
|
|
||||||
let reset_signal_handlers = true;
|
|
||||||
|
|
||||||
// Remove all signal blocks.
|
|
||||||
let reset_sigmask = true;
|
|
||||||
|
|
||||||
// Set our flags.
|
// Set our flags.
|
||||||
let mut flags: i32 = 0;
|
let mut flags: i32 = 0;
|
||||||
if reset_signal_handlers {
|
|
||||||
flags |= libc::POSIX_SPAWN_SETSIGDEF;
|
flags |= libc::POSIX_SPAWN_SETSIGDEF;
|
||||||
}
|
|
||||||
if reset_sigmask {
|
|
||||||
flags |= libc::POSIX_SPAWN_SETSIGMASK;
|
flags |= libc::POSIX_SPAWN_SETSIGMASK;
|
||||||
}
|
|
||||||
if desired_pgid.is_some() {
|
if desired_pgid.is_some() {
|
||||||
flags |= libc::POSIX_SPAWN_SETPGROUP;
|
flags |= libc::POSIX_SPAWN_SETPGROUP;
|
||||||
}
|
}
|
||||||
|
@ -136,19 +126,15 @@ impl PosixSpawner {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Everybody gets default handlers.
|
// Everybody gets default handlers.
|
||||||
if reset_signal_handlers {
|
|
||||||
let mut sigdefault: libc::sigset_t = unsafe { std::mem::zeroed() };
|
let mut sigdefault: libc::sigset_t = unsafe { std::mem::zeroed() };
|
||||||
get_signals_with_handlers(&mut sigdefault);
|
get_signals_with_handlers(&mut sigdefault);
|
||||||
attr.set_sigdefault(&sigdefault)?;
|
attr.set_sigdefault(&sigdefault)?;
|
||||||
}
|
|
||||||
|
|
||||||
// Potentially reset the sigmask.
|
// Reset the sigmask.
|
||||||
if reset_sigmask {
|
|
||||||
let mut sigmask = unsafe { std::mem::zeroed() };
|
let mut sigmask = unsafe { std::mem::zeroed() };
|
||||||
unsafe { libc::sigemptyset(&mut sigmask) };
|
unsafe { libc::sigemptyset(&mut sigmask) };
|
||||||
blocked_signals_for_job(j, &mut sigmask);
|
blocked_signals_for_job(j, &mut sigmask);
|
||||||
attr.set_sigmask(&sigmask)?;
|
attr.set_sigmask(&sigmask)?;
|
||||||
}
|
|
||||||
|
|
||||||
// Apply our dup2s.
|
// Apply our dup2s.
|
||||||
for act in dup2s.get_actions() {
|
for act in dup2s.get_actions() {
|
||||||
|
|
Loading…
Reference in a new issue