X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.cc;h=b28decc23a68b65d528ef489158f91c574727bc5;hb=d7cc09cebd23e052f230414f0ad7fb385e3cd2ef;hp=e9d1250088d65aa1e71068a1a15f7a4060b8f051;hpb=cef2672ec88e60855e16229c2c95fdbcc9c59c2f;p=chaz%2Fopenbox diff --git a/src/openbox.cc b/src/openbox.cc index e9d12500..b28decc2 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -58,19 +58,19 @@ Openbox *Openbox::instance = (Openbox *) 0; void Openbox::signalHandler(int signal) { switch (signal) { - case SIGHUP: - // XXX: Do something with HUP? Really shouldn't, we get this when X shuts - // down and hangs-up on us. we also get a SIGPIPE. - printf("Caught HUP signal. Restarting.\n"); + case SIGUSR1: + printf("Caught SIGUSR1 signal. Restarting.\n"); instance->restart(); break; - + + case SIGHUP: case SIGINT: case SIGTERM: case SIGPIPE: printf("Caught signal %d. Exiting.\n", signal); instance->shutdown(); break; + case SIGFPE: case SIGSEGV: printf("Caught signal %d. Aborting and dumping core.\n", signal); @@ -110,6 +110,7 @@ Openbox::Openbox(int argc, char **argv) action.sa_handler = Openbox::signalHandler; action.sa_mask = sigset_t(); action.sa_flags = SA_NOCLDSTOP | SA_NODEFER; + sigaction(SIGUSR1, &action, (struct sigaction *) 0); sigaction(SIGPIPE, &action, (struct sigaction *) 0); sigaction(SIGSEGV, &action, (struct sigaction *) 0); sigaction(SIGFPE, &action, (struct sigaction *) 0);