Reset signal mask before executing commands (issue #674)
This commit is contained in:
parent
50c7bf77de
commit
407aef3786
3 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue