Skip to content
Snippets Groups Projects
Commit dd646df4 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Switch to sigaction() from signal();siginterrupt()

It seems Linux has deprecated siginterrupt(), and they've been
aggressive about removing deprecated C functions lately.
parent 33f387fb
No related branches found
No related tags found
No related merge requests found
...@@ -1197,6 +1197,9 @@ int main(int argc, char **argv, char** env) ...@@ -1197,6 +1197,9 @@ int main(int argc, char **argv, char** env)
FILE* fp; FILE* fp;
char ini_fname[MAX_PATH + 1]; char ini_fname[MAX_PATH + 1];
str_list_t ini = NULL; str_list_t ini = NULL;
#ifdef __unix__
struct sigaction sa = {0};
#endif
confp=stdout; confp=stdout;
errfp=stderr; errfp=stderr;
...@@ -1485,12 +1488,10 @@ int main(int argc, char **argv, char** env) ...@@ -1485,12 +1488,10 @@ int main(int argc, char **argv, char** env)
#if defined(_WIN32) #if defined(_WIN32)
SetConsoleCtrlHandler(ControlHandler, TRUE /* Add */); SetConsoleCtrlHandler(ControlHandler, TRUE /* Add */);
#elif defined(__unix__) #elif defined(__unix__)
signal(SIGQUIT,break_handler); sa.sa_handler = break_handler;
siginterrupt(SIGQUIT, 1); sigaction(SIGQUIT, &sa, NULL);
signal(SIGINT,break_handler); sigaction(SIGINT, &sa, NULL);
siginterrupt(SIGINT, 1); sigaction(SIGTERM, &sa, NULL);
signal(SIGTERM,break_handler);
siginterrupt(SIGTERM, 1);
signal(SIGHUP,recycle_handler); signal(SIGHUP,recycle_handler);
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef _CONN_H_ #ifndef _CONN_H_
#define _CONN_H_ #define _CONN_H_
#include <stdbool.h>
#include "sockwrap.h" #include "sockwrap.h"
#include "threadwrap.h" #include "threadwrap.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment