rem: destroy_aaa_core(); exit(0);
add: switch (signo) { case 0: break;  case SIGPIPE: LOG(L_WARN, "WARNING: SIGPIPE received and ignored\n"); break; case SIGINT: case SIGTERM: if (signo==SIGINT) DBG("SIGINT received, program terminates\n"); else DBG("SIGTERM received, program terminates\n"); destroy_aaa_core(); exit(0); break; case SIGHUP:  DBG("SIGHUP received, ignoring it\n"); break; case SIGUSR1: LOG(memlog, "Memory status (shm):\n"); shm_status(); break; default: LOG(L_CRIT, "WARNING: unhandled signal %d\n", signo); }
context: static void sig_handler(int signo){	if ( main_thread==pthread_self() ) {		destroy_aaa_core();		exit(0);	}	return;}