zabbix-agent2/src/libs/zbxnix/sighandler.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_set_common_signal_handlers                                   *
 *                                                                            *
 * Purpose: set the commonly used signal handlers                             *
 *                                                                            *
 ******************************************************************************/
zbx_set_common_signal_handlers

Purpose: set the commonly used signal handlers
zbx_set_common_signal_handlers Purpose : set the commonly used signal handlers
void	zbx_set_common_signal_handlers(void)
{
	struct sigaction	phan;
	sig_parent_pid = (int)getpid();
	sigemptyset(&phan.sa_mask);
	phan.sa_flags = SA_SIGINFO;
	phan.sa_sigaction = terminate_signal_handler;
	sigaction(SIGINT, &phan, NULL);
	sigaction(SIGQUIT, &phan, NULL);
	sigaction(SIGHUP, &phan, NULL);
	sigaction(SIGTERM, &phan, NULL);
	sigaction(SIGUSR2, &phan, NULL);
	phan.sa_sigaction = fatal_signal_handler;
	sigaction(SIGILL, &phan, NULL);
	sigaction(SIGFPE, &phan, NULL);
	sigaction(SIGSEGV, &phan, NULL);
	sigaction(SIGBUS, &phan, NULL);
	phan.sa_sigaction = alarm_signal_handler;
	sigaction(SIGALRM, &phan, NULL);
}
void zbx_set_common_signal_handlers ( void ) { struct sigaction phan ; sig_parent_pid = ( int ) getpid ( ) ; sigemptyset ( & phan . sa_mask ) ; phan . sa_flags = SA_SIGINFO ; phan . sa_sigaction = terminate_signal_handler ; sigaction ( SIGINT , & phan , NULL ) ; sigaction ( SIGQUIT , & phan , NULL ) ; sigaction ( SIGHUP , & phan , NULL ) ; sigaction ( SIGTERM , & phan , NULL ) ; sigaction ( SIGUSR2 , & phan , NULL ) ; phan . sa_sigaction = fatal_signal_handler ; sigaction ( SIGILL , & phan , NULL ) ; sigaction ( SIGFPE , & phan , NULL ) ; sigaction ( SIGSEGV , & phan , NULL ) ; sigaction ( SIGBUS , & phan , NULL ) ; phan . sa_sigaction = alarm_signal_handler ; sigaction ( SIGALRM , & phan , NULL ) ; }
Function: zbx_set_common_signal_handlers                                   
                                                                            
 Purpose: set the commonly used signal handlers
Function : zbx_set_common_signal_handlers Purpose : set the commonly used signal handlers