Permalink
Browse files

split out sigterm handling from sigsegv, so that term is always handled.

  • Loading branch information...
1 parent 9b48a58 commit 497299df830483556c9e3ba2e359dbbefc3cd729 Robey Pointer committed Aug 20, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/redis.c
View
@@ -778,6 +778,7 @@ void initServer() {
if (!server.dumpcore) {
setupSigSegvAction();
}
+ setupSigTermAction();
server.mainthread = pthread_self();
server.devnull = fopen("/dev/null","w");
@@ -1532,11 +1533,15 @@ void setupSigSegvAction(void) {
sigaction (SIGFPE, &act, NULL);
sigaction (SIGILL, &act, NULL);
sigaction (SIGBUS, &act, NULL);
+}
+
+void setupSigTermAction(void) {
+ struct sigaction act;
+ sigemptyset (&act.sa_mask);
act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
act.sa_handler = sigtermHandler;
sigaction (SIGTERM, &act, NULL);
- return;
}
#else /* HAVE_BACKTRACE */

0 comments on commit 497299d

Please sign in to comment.