提交 497299df 编写于 作者: R Robey Pointer

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

上级 9b48a589
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册