diff --git a/awesome.c b/awesome.c index fd8ecd70..ec748d36 100644 --- a/awesome.c +++ b/awesome.c @@ -236,7 +236,7 @@ xerrorstart(void * data __attribute__ ((unused)), } static void -signal_fatal(EV_P_ ev_signal *w, int revents) +signal_fatal(int signum) { buffer_t buf; backtrace_get(&buf); @@ -408,7 +408,6 @@ main(int argc, char **argv) ev_signal_init(&sigint, exit_on_signal, SIGINT); ev_signal_init(&sigterm, exit_on_signal, SIGTERM); ev_signal_init(&sighup, restart_on_signal, SIGHUP); - ev_signal_init(&sighup, signal_fatal, SIGSEGV); ev_signal_start(globalconf.loop, &sigint); ev_signal_start(globalconf.loop, &sigterm); ev_signal_start(globalconf.loop, &sighup); @@ -416,6 +415,10 @@ main(int argc, char **argv) ev_unref(globalconf.loop); ev_unref(globalconf.loop); + struct sigaction sa = { .sa_handler = signal_fatal, .sa_flags = 0 }; + sigemptyset(&sa.sa_mask); + sigaction(SIGSEGV, &sa, 0); + /* X stuff */ globalconf.connection = xcb_connect(NULL, &globalconf.default_screen); if(xcb_connection_has_error(globalconf.connection))