Skip to content
Snippets Groups Projects
Commit 0f628a71 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 3ac3c1fd
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3482 passed
......@@ -1197,6 +1197,9 @@ int main(int argc, char **argv, char** env)
FILE* fp;
char ini_fname[MAX_PATH + 1];
str_list_t ini = NULL;
#ifdef __unix__
struct sigaction sa = {0};
#endif
confp=stdout;
errfp=stderr;
......@@ -1485,12 +1488,10 @@ int main(int argc, char **argv, char** env)
#if defined(_WIN32)
SetConsoleCtrlHandler(ControlHandler, TRUE /* Add */);
#elif defined(__unix__)
signal(SIGQUIT,break_handler);
siginterrupt(SIGQUIT, 1);
signal(SIGINT,break_handler);
siginterrupt(SIGINT, 1);
signal(SIGTERM,break_handler);
siginterrupt(SIGTERM, 1);
sa.sa_handler = break_handler;
sigaction(SIGQUIT, &sa, NULL);
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
signal(SIGHUP,recycle_handler);
......
......@@ -5,6 +5,8 @@
#ifndef _CONN_H_
#define _CONN_H_
#include <stdbool.h>
#include "sockwrap.h"
#include "threadwrap.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment