Use volatile sig_atomic_t instead of int

This commit is contained in:
2022-10-13 15:42:31 +02:00
parent 100eb1597d
commit 92779e5dba
3 changed files with 4 additions and 3 deletions

View File

@ -29,7 +29,7 @@
#include <arpa/inet.h>
int server_keep_alive = 1;
volatile sig_atomic_t server_keep_alive = 1;
struct timeval client_timeout = {.tv_sec = CLIENT_TIMEOUT, .tv_usec = 0};
char *log_client_prefix, *log_conn_prefix, *log_req_prefix, *client_geoip;

View File

@ -35,7 +35,7 @@
#include <dirent.h>
int active = 1;
volatile sig_atomic_t active = 1;
const char *config_file;
int sockets[NUM_SOCKETS];
pid_t children[MAX_CHILDREN];

View File

@ -10,6 +10,7 @@
#include <sys/time.h>
#include <maxminddb.h>
#include <signal.h>
#define NUM_SOCKETS 2
#define MAX_CHILDREN 1024
@ -25,7 +26,7 @@ extern int sockets[NUM_SOCKETS];
extern pid_t children[MAX_CHILDREN];
extern MMDB_s mmdbs[MAX_MMDB];
extern int server_keep_alive;
extern volatile sig_atomic_t server_keep_alive;
extern char *log_client_prefix, *log_conn_prefix, *log_req_prefix, *client_geoip;
extern char *client_addr_str, *client_addr_str_ptr, *server_addr_str, *server_addr_str_ptr, *client_host_str;
extern struct timeval client_timeout;