Commit 407aef37 authored by o9000's avatar o9000

Reset signal mask before executing commands (issue #674)

parent 50c7bf77
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment