mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
slave: ignore SIGHUP, instead of resetting it to DFL
This aligns foot's behavior with e.g. XTerm, when running 'foot
script.sh', where script.sh is:
#!/usr/bin/bash
sleep 2s
exec setsid --fork sh -c 'sleep 5; notify-send test'
Before this patch, 'notify-send' never ran. With this patch it does.
I don't, yet, fully understand what's happening here, or what's "more"
correct.
See #1666
This commit is contained in:
parent
c7848c4e75
commit
60a6991c25
1 changed files with 4 additions and 1 deletions
5
slave.c
5
slave.c
|
|
@ -406,8 +406,11 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv,
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
sigemptyset(&mask);
|
sigemptyset(&mask);
|
||||||
|
|
||||||
|
struct sigaction ign = {.sa_handler = SIG_IGN};
|
||||||
|
sigemptyset(&ign.sa_mask);
|
||||||
|
|
||||||
if (sigprocmask(SIG_SETMASK, &mask, NULL) < 0 ||
|
if (sigprocmask(SIG_SETMASK, &mask, NULL) < 0 ||
|
||||||
sigaction(SIGHUP, &dfl, NULL) < 0 ||
|
sigaction(SIGHUP, &ign, NULL) < 0 ||
|
||||||
sigaction(SIGPIPE, &dfl, NULL) < 0)
|
sigaction(SIGPIPE, &dfl, NULL) < 0)
|
||||||
{
|
{
|
||||||
const int errno_copy = errno;
|
const int errno_copy = errno;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue