diff options
Diffstat (limited to 'server/main.c')
-rw-r--r-- | server/main.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/server/main.c b/server/main.c index b6745e0..0d8d9f3 100644 --- a/server/main.c +++ b/server/main.c @@ -3,6 +3,7 @@ #define HSET_MAX_BUCKET_SIZE 4 #include <container.h> #undef CONTAINER_IMPLEMENTATION +#include <log.h> #include "tcp.h" @@ -11,22 +12,18 @@ #define MAIN_PORT 8164 void setup_signal(void) { - struct sigaction signal = {.sa_handler = print_state, .sa_mask = {{0}}, .sa_flags = 0}; - if (sigaction(SIGUSR1, &signal, NULL) != 0) { - WHERE; - exit(EXIT_FAILURE); - } + struct sigaction signal = {.sa_handler = print_state, .sa_mask = {{0}}, .sa_flags = SA_RESTART}; + if (sigaction(SIGUSR1, &signal, NULL) != 0) LFAILV("sigaction"); signal.sa_handler = exit_tcp; - if (sigaction(SIGTERM, &signal, NULL) != 0) { - WHERE; - exit(EXIT_FAILURE); - } + if (sigaction(SIGTERM, &signal, NULL) != 0) LFAILV("sigaction"); } int main(int argc, char *argv[]) { (void)argc; (void)argv; setup_signal(); - tcp_loop(); + new_tcp_loop(); return 0; } + +/* vim: set ts=8 noet: */ |