删除不必要的子进程信号
glib 会自动处理子进程资源,无需手动处理,手动处理不当反而会造成 bug
This commit is contained in:
15
src/wm.c
15
src/wm.c
@@ -50,9 +50,6 @@ wm_t wm;
|
||||
/** argv used to run wm */
|
||||
static char **cmd_argv;
|
||||
|
||||
/** A pipe that is used to asynchronously handle SIGCHLD */
|
||||
static int sigchld_pipe[2];
|
||||
|
||||
static gboolean restart_on_signal(gpointer data) {
|
||||
wm_restart();
|
||||
return TRUE;
|
||||
@@ -69,14 +66,6 @@ static void signal_fatal(int signal_number) {
|
||||
fatal("signal %d, dumping backtrace\n%s", signal_number, buffer.s);
|
||||
}
|
||||
|
||||
/* Signal handler for SIGCHLD. Causes reap_children() to be called. */
|
||||
static void signal_child(int signum) {
|
||||
assert(signum == SIGCHLD);
|
||||
int res = write(sigchld_pipe[1], " ", 1);
|
||||
(void)res;
|
||||
assert(res == 1);
|
||||
}
|
||||
|
||||
static guint sources[3] = {0};
|
||||
|
||||
void wm_setup_signal(void) {
|
||||
@@ -92,10 +81,6 @@ void wm_setup_signal(void) {
|
||||
sigaction(SIGILL, &sa, 0);
|
||||
sigaction(SIGSEGV, &sa, 0);
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
sa.sa_handler = signal_child;
|
||||
sa.sa_flags = SA_NOCLDSTOP | SA_RESTART;
|
||||
sigaction(SIGCHLD, &sa, 0);
|
||||
}
|
||||
|
||||
void wm_check_other_wm(void) {
|
||||
|
||||
Reference in New Issue
Block a user