mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-05-03 06:46:42 -04:00
slave: restore signal mask
This commit is contained in:
parent
789617d5ad
commit
c605503df6
2 changed files with 5 additions and 1 deletions
|
|
@ -42,6 +42,7 @@
|
||||||
* Rare crash when scrolling and the new viewport ended up **exactly**
|
* Rare crash when scrolling and the new viewport ended up **exactly**
|
||||||
on the wrap around.
|
on the wrap around.
|
||||||
* Selection handling when viewport wrapped around.
|
* Selection handling when viewport wrapped around.
|
||||||
|
* Restore signal mask in the slave process.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
5
slave.c
5
slave.c
|
|
@ -166,10 +166,13 @@ slave_spawn(int ptmx, int argc, const char *cwd, char *const *argv,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore signals */
|
/* Restore signals */
|
||||||
|
sigset_t mask;
|
||||||
|
sigemptyset(&mask);
|
||||||
const struct sigaction sa = {.sa_handler = SIG_DFL};
|
const struct sigaction sa = {.sa_handler = SIG_DFL};
|
||||||
if (sigaction(SIGINT, &sa, NULL) < 0 ||
|
if (sigaction(SIGINT, &sa, NULL) < 0 ||
|
||||||
sigaction(SIGTERM, &sa, NULL) < 0 ||
|
sigaction(SIGTERM, &sa, NULL) < 0 ||
|
||||||
sigaction(SIGHUP, &sa, NULL) < 0)
|
sigaction(SIGHUP, &sa, NULL) < 0 ||
|
||||||
|
sigprocmask(SIG_SETMASK, &mask, NULL) < 0)
|
||||||
{
|
{
|
||||||
const int _errno = errno;
|
const int _errno = errno;
|
||||||
LOG_ERRNO_P("failed to restore signals", errno);
|
LOG_ERRNO_P("failed to restore signals", errno);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue