示例#1
0
/*
 * Log and then exit with error status.
 */
void
xerrlog(int level, char *fmt, ...)
{
	va_list	ap;

	va_start(ap, fmt);
	doerrlog(level, fmt, ap);
	va_end(ap);

	ssh_kill();
	unlink_pid_file();
	_exit(1);
}
示例#2
0
文件: main.c 项目: KevinQi1981/irid
/**
 * @desc 关闭程序
 * @param int signo 信号
 * @return void
 */
void server_end(int signo)
{
	//防止重复关闭
	if(SERVER_STATUS_CLOSE == g_status) return;
	g_status = SERVER_STATUS_CLOSE;
	//关闭socket
	shutdown_epoll_socket(g_epoll_socket);
	//关闭thread
	shutdown_epoll_thread(g_thread);
	//释放内存资源
	destroy_epoll_thread(g_thread);
	destroy_epoll_socket(g_epoll_socket);
	destroy_lrumc(g_lrumc);
	DFREE(g_lrumc_config);
	unlink_pid_file();
}