@@ -46,15 +46,14 @@ inline void sig_term_handler(int signum, siginfo_t *info, void *ptr) {
4646 exit (EXIT_SUCCESS);
4747}
4848
49-
5049inline void sig_usr1_handler (int signum, siginfo_t *info, void *ptr) {
5150 if (gettid () != CAPIO_SERVER_MAIN_PID) {
5251 return ;
5352 }
5453 START_LOG (gettid (), " call(signal=[%d] (%s) from process with pid=%ld)" , signum,
5554 strsignal (signum), info != nullptr ? info->si_pid : -1 );
5655 std::cout << CAPIO_LOG_SERVER_CLI_LEVEL_WARNING << " [ " << node_name << " ] "
57- << " Recived request for graceful shutdown!" << std::endl;
56+ << " Received request for graceful shutdown!" << std::endl;
5857 termination_phase = true ;
5958}
6059
@@ -67,28 +66,23 @@ inline void setup_signal_handlers() {
6766 static struct sigaction sigact, sigact_usr1;
6867 memset (&sigact, 0 , sizeof (sigact));
6968 memset (&sigact, 0 , sizeof (sigact_usr1));
70- sigact.sa_sigaction = sig_term_handler;
71- sigact.sa_flags = SA_SIGINFO;
69+ sigact.sa_sigaction = sig_term_handler;
70+ sigact.sa_flags = SA_SIGINFO;
7271 sigact_usr1.sa_sigaction = sig_usr1_handler;
7372 sigact_usr1.sa_flags = SA_SIGINFO;
74- int res = sigaction (SIGTERM, &sigact, nullptr );
75- res = res | sigaction (SIGILL, &sigact, nullptr );
76- res = res | sigaction (SIGABRT, &sigact, nullptr );
77- res = res | sigaction (SIGFPE, &sigact, nullptr );
78- res = res | sigaction (SIGSEGV, &sigact, nullptr );
79- res = res | sigaction (SIGQUIT, &sigact, nullptr );
80- res = res | sigaction (SIGPIPE, &sigact, nullptr );
81- res = res | sigaction (SIGINT, &sigact, nullptr );
82- res = res | sigaction (SIGUSR1, &sigact_usr1, nullptr );
73+ int res = sigaction (SIGTERM, &sigact, nullptr ) | sigaction (SIGILL, &sigact, nullptr ) |
74+ sigaction (SIGABRT, &sigact, nullptr ) | sigaction (SIGFPE, &sigact, nullptr ) |
75+ sigaction (SIGSEGV, &sigact, nullptr ) | sigaction (SIGQUIT, &sigact, nullptr ) |
76+ sigaction (SIGPIPE, &sigact, nullptr ) | sigaction (SIGINT, &sigact, nullptr ) |
77+ sigaction (SIGUSR1, &sigact_usr1, nullptr );
8378 if (res == -1 ) {
8479 ERR_EXIT (" sigaction for SIGTERM" );
8580 }
8681}
8782
88-
8983/*
9084 * Defining here the RequestHandlerEngine::handle_termination_phase()
91- * to avoid recursive include wihin the header files
85+ * to avoid recursive include within the header files
9286 */
9387inline void RequestHandlerEngine::handle_termination_phase () const {
9488 START_LOG (capio_syscall (SYS_gettid), " call()" );
@@ -100,5 +94,4 @@ inline void RequestHandlerEngine::handle_termination_phase() const {
10094 sig_term_handler (SIGTERM, nullptr , nullptr );
10195}
10296
103-
10497#endif // CAPIO_SERVER_HANDLERS_SIGNALS_HPP
0 commit comments