Use (void) instead of void
This commit is contained in:
@ -48,7 +48,7 @@ host_config *get_host_config(const char *host) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void client_terminate() {
|
void client_terminate(int _) {
|
||||||
server_keep_alive = 0;
|
server_keep_alive = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ int cache_continue = 1;
|
|||||||
magic_t magic;
|
magic_t magic;
|
||||||
cache_entry *cache;
|
cache_entry *cache;
|
||||||
|
|
||||||
int magic_init() {
|
int magic_init(void) {
|
||||||
magic = magic_open(MAGIC_MIME);
|
magic = magic_open(MAGIC_MIME);
|
||||||
if (magic == NULL) {
|
if (magic == NULL) {
|
||||||
fprintf(stderr, ERR_STR "Unable to open magic cookie: %s" CLR_STR "\n", strerror(errno));
|
fprintf(stderr, ERR_STR "Unable to open magic cookie: %s" CLR_STR "\n", strerror(errno));
|
||||||
@ -37,11 +37,11 @@ int magic_init() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cache_process_term() {
|
void cache_process_term(int _) {
|
||||||
cache_continue = 0;
|
cache_continue = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cache_process() {
|
int cache_process(void) {
|
||||||
signal(SIGINT, cache_process_term);
|
signal(SIGINT, cache_process_term);
|
||||||
signal(SIGTERM, cache_process_term);
|
signal(SIGTERM, cache_process_term);
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ int cache_process() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cache_init() {
|
int cache_init(void) {
|
||||||
if (magic_init() != 0) {
|
if (magic_init() != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -267,7 +267,7 @@ int cache_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int cache_unload() {
|
int cache_unload(void) {
|
||||||
int shm_id = shmget(CACHE_SHM_KEY, 0, 0);
|
int shm_id = shmget(CACHE_SHM_KEY, 0, 0);
|
||||||
if (shm_id < 0) {
|
if (shm_id < 0) {
|
||||||
fprintf(stderr, ERR_STR "Unable to get cache shared memory id: %s" CLR_STR "\n", strerror(errno));
|
fprintf(stderr, ERR_STR "Unable to get cache shared memory id: %s" CLR_STR "\n", strerror(errno));
|
||||||
|
@ -30,15 +30,15 @@ extern cache_entry *cache;
|
|||||||
|
|
||||||
extern int cache_continue;
|
extern int cache_continue;
|
||||||
|
|
||||||
int magic_init();
|
int magic_init(void);
|
||||||
|
|
||||||
void cache_process_term();
|
void cache_process_term(int _);
|
||||||
|
|
||||||
int cache_process();
|
int cache_process(void);
|
||||||
|
|
||||||
int cache_init();
|
int cache_init(void);
|
||||||
|
|
||||||
int cache_unload();
|
int cache_unload(void);
|
||||||
|
|
||||||
int cache_update_entry(int entry_num, const char *filename, const char *webroot);
|
int cache_update_entry(int entry_num, const char *filename, const char *webroot);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
t_config *config;
|
t_config *config;
|
||||||
char geoip_dir[256], dns_server[256];
|
char geoip_dir[256], dns_server[256];
|
||||||
|
|
||||||
int config_init() {
|
int config_init(void) {
|
||||||
int shm_id = shmget(CONFIG_SHM_KEY, sizeof(t_config), IPC_CREAT | IPC_EXCL | 0640);
|
int shm_id = shmget(CONFIG_SHM_KEY, sizeof(t_config), IPC_CREAT | IPC_EXCL | 0640);
|
||||||
if (shm_id < 0) {
|
if (shm_id < 0) {
|
||||||
fprintf(stderr, ERR_STR "Unable to create config shared memory: %s" CLR_STR "\n", strerror(errno));
|
fprintf(stderr, ERR_STR "Unable to create config shared memory: %s" CLR_STR "\n", strerror(errno));
|
||||||
@ -45,7 +45,7 @@ int config_init() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int config_unload() {
|
int config_unload(void) {
|
||||||
int shm_id = shmget(CONFIG_SHM_KEY, 0, 0);
|
int shm_id = shmget(CONFIG_SHM_KEY, 0, 0);
|
||||||
if (shm_id < 0) {
|
if (shm_id < 0) {
|
||||||
fprintf(stderr, ERR_STR "Unable to get config shared memory id: %s" CLR_STR "\n", strerror(errno));
|
fprintf(stderr, ERR_STR "Unable to get config shared memory id: %s" CLR_STR "\n", strerror(errno));
|
||||||
|
@ -55,10 +55,10 @@ typedef struct {
|
|||||||
extern t_config *config;
|
extern t_config *config;
|
||||||
extern char geoip_dir[256], dns_server[256];
|
extern char geoip_dir[256], dns_server[256];
|
||||||
|
|
||||||
int config_init();
|
int config_init(void);
|
||||||
|
|
||||||
int config_load(const char *filename);
|
int config_load(const char *filename);
|
||||||
|
|
||||||
int config_unload();
|
int config_unload(void);
|
||||||
|
|
||||||
#endif //SESIMOS_CONFIG_H
|
#endif //SESIMOS_CONFIG_H
|
||||||
|
@ -23,7 +23,7 @@ sock rev_proxy;
|
|||||||
char *rev_proxy_host = NULL;
|
char *rev_proxy_host = NULL;
|
||||||
struct timeval server_timeout = {.tv_sec = SERVER_TIMEOUT, .tv_usec = 0};
|
struct timeval server_timeout = {.tv_sec = SERVER_TIMEOUT, .tv_usec = 0};
|
||||||
|
|
||||||
int rev_proxy_preload() {
|
int rev_proxy_preload(void) {
|
||||||
rev_proxy.buf = NULL;
|
rev_proxy.buf = NULL;
|
||||||
rev_proxy.buf_len = 0;
|
rev_proxy.buf_len = 0;
|
||||||
rev_proxy.buf_off = 0;
|
rev_proxy.buf_off = 0;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
extern sock rev_proxy;
|
extern sock rev_proxy;
|
||||||
|
|
||||||
int rev_proxy_preload();
|
int rev_proxy_preload(void);
|
||||||
|
|
||||||
int rev_proxy_request_header(http_req *req, int enc);
|
int rev_proxy_request_header(http_req *req, int enc);
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
|
||||||
int terminate = 0;
|
volatile sig_atomic_t terminate = 0;
|
||||||
|
|
||||||
void ws_terminate() {
|
void ws_terminate(int _) {
|
||||||
terminate = 1;
|
terminate = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ pid_t children[MAX_CHILDREN];
|
|||||||
MMDB_s mmdbs[MAX_MMDB];
|
MMDB_s mmdbs[MAX_MMDB];
|
||||||
SSL_CTX *contexts[CONFIG_MAX_CERT_CONFIG];
|
SSL_CTX *contexts[CONFIG_MAX_CERT_CONFIG];
|
||||||
|
|
||||||
void openssl_init() {
|
void openssl_init(void) {
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
ERR_load_BIO_strings();
|
ERR_load_BIO_strings();
|
||||||
@ -58,7 +58,7 @@ static int ssl_servername_cb(SSL *ssl, int *ad, void *arg) {
|
|||||||
return SSL_TLSEXT_ERR_OK;
|
return SSL_TLSEXT_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroy() {
|
void destroy(int _) {
|
||||||
fprintf(stderr, "\n" ERR_STR "Terminating forcefully!" CLR_STR "\n");
|
fprintf(stderr, "\n" ERR_STR "Terminating forcefully!" CLR_STR "\n");
|
||||||
int status = 0;
|
int status = 0;
|
||||||
int ret;
|
int ret;
|
||||||
@ -87,7 +87,7 @@ void destroy() {
|
|||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void terminate() {
|
void terminate(int _) {
|
||||||
fprintf(stderr, "\nTerminating gracefully...\n");
|
fprintf(stderr, "\nTerminating gracefully...\n");
|
||||||
active = 0;
|
active = 0;
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ int main(int argc, const char *argv[]) {
|
|||||||
ready_sockets_num = poll(poll_fds, NUM_SOCKETS, 1000);
|
ready_sockets_num = poll(poll_fds, NUM_SOCKETS, 1000);
|
||||||
if (ready_sockets_num < 0) {
|
if (ready_sockets_num < 0) {
|
||||||
fprintf(stderr, ERR_STR "Unable to poll sockets: %s" CLR_STR "\n", strerror(errno));
|
fprintf(stderr, ERR_STR "Unable to poll sockets: %s" CLR_STR "\n", strerror(errno));
|
||||||
terminate();
|
terminate(0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user