Reset signal mask before executing commands (issue #674)

This commit is contained in:
o9000 2017-10-15 13:00:18 +02:00
parent 50c7bf77de
commit 407aef3786
3 changed files with 13 additions and 0 deletions

View file

@ -24,6 +24,16 @@ void signal_handler(int sig)
signal_pending = sig;
}
void reset_signals()
{
for (int sig = 1; sig < 32; sig++) {
signal(sig, SIG_DFL);
}
sigset_t signal_set;
sigemptyset(&signal_set);
sigprocmask(SIG_SETMASK, &signal_set, NULL);
}
void init_signals()
{
// Set signal handlers

View file

@ -5,6 +5,7 @@ void init_signals();
void init_signals_postconfig();
void emit_self_restart(const char *reason);
int get_signal_pending();
void reset_signals();
void handle_sigchld_events();

View file

@ -59,6 +59,7 @@
#include "../panel.h"
#include "timer.h"
#include "signals.h"
void write_string(int fd, const char *s)
{
@ -398,6 +399,7 @@ pid_t tint_exec(const char *command,
if (dir)
chdir(dir);
close_all_fds();
reset_signals();
if (terminal) {
#if !defined(__OpenBSD__)
fprintf(stderr, "tint2: executing in x-terminal-emulator: %s\n", command);