• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ signals_init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中signals_init函数的典型用法代码示例。如果您正苦于以下问题:C++ signals_init函数的具体用法?C++ signals_init怎么用?C++ signals_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了signals_init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: init_main

int init_main(void)
{
#ifdef __IBMC__
       signals_init(0);
#else
       signals_init(debug.do_core_dumps);
#endif

    romset_init();

    if (!video_disabled_mode) {
        palette_init();
    }

    if (machine_class != VICE_MACHINE_VSID) {
        screenshot_init();

        drive_cpu_early_init_all();
    }

    machine_bus_init();
    machine_maincpu_init();

    /* Machine-specific initialization.  */
    if (machine_init() < 0) {
        log_error(LOG_DEFAULT, "Machine initialization failed.");
        return -1;
    }

    /* FIXME: what's about uimon_init??? */
    /* the monitor console MUST be available, because of for example cpujam,
       or -initbreak from cmdline.
    */
    if (console_init() < 0) {
        log_error(LOG_DEFAULT, "Console initialization failed.");
        return -1;
    }

    keyboard_init();

    if (machine_class != VICE_MACHINE_VSID) {
        vdrive_init();
    }

    ui_init_finalize();

    return 0;
}
开发者ID:OpenEmu,项目名称:VICE-Core,代码行数:48,代码来源:init.c


示例2: core_init

void core_init(void)
{
	modules_init();
#ifndef WIN32
	pidwait_init();
#endif

	net_disconnect_init();
	net_sendbuffer_init();
	signals_init();
	settings_init();
	commands_init();
        nickmatch_cache_init();

	chat_protocols_init();
	chatnets_init();
        expandos_init();
	ignore_init();
	servers_init();
        write_buffer_init();
	log_init();
	rawlog_init();

	channels_init();
	queries_init();
	nicklist_init();

	chat_commands_init();
        settings_check();
}
开发者ID:svn2github,项目名称:irssi,代码行数:30,代码来源:core.c


示例3: main

int main(int argc, char *argv[])
{
    me.ev = mowgli_eventloop_create();

    signals_init();

    parse_commandline_options(argc, argv);

    me.config = mowgli_config_file_load(config_file);

    if(me.config == NULL)
        sigyn_fatal("Cannot load configuration file.");
    logger_init(me.config->entries);
    config_check(me.config);

    me.uplink.line = new_conn(me.uplink.hostname, me.uplink.port, me.uplink.ssl, read_irc, NULL);
    if (me.uplink.line == NULL)
        sigyn_fatal("Connection to uplink failed.");
    me.uplink.connected = true;

    loadmodules(me.config->entries);

    sigyn_introduce_client(me.client->nick, me.client->user, NULL);
    if (should_fork)
        daemonise(SYSCONFDIR "/sigyn.pid");
    mowgli_eventloop_run(me.ev);

    sigyn_cleanup();
    return EXIT_SUCCESS;
}
开发者ID:alyx,项目名称:sigyn,代码行数:30,代码来源:sigyn.c


示例4: main

int main(int ac, char **av, char **ev)
{
	struct stat tmp;
	char *file;
	pid_t pid;

	if (ac < 2)
		print_help();
	if (!(file = get_file_path(av[1], ev)))
	{
		ft_putendl_fd("Can't find exec in path", 2);
		exit(EXIT_SUCCESS);
	}
	if (stat(file, &tmp) == -1)
	{
		ft_putstr_fd("ft_strace: \"", 2);
		ft_putstr_fd(av[1], 2);
		ft_putstr_fd("\": No such file or directory", 2);
		exit(EXIT_FAILURE);
	}
	syscalls_init();
	signals_init();
	errno_init();
	pid = fork();
	if (pid == -1)
	{
		ft_putendl_fd("ft_strace: failed to fork", 2);
		exit(EXIT_FAILURE);
	}
	else if (pid == 0)
		child_launch(av, file);
	else
		parent_launch(pid);
	return (EXIT_SUCCESS);
}
开发者ID:acazuc,项目名称:42_ft_strace,代码行数:35,代码来源:main.c


示例5: main

/*======================================
 *	CORE : MAINROUTINE
 *--------------------------------------*/
int main (int argc, char **argv)
{
	{// initialize program arguments
		char *p1 = SERVER_NAME = argv[0];
		char *p2 = p1;
		while ((p1 = strchr(p2, '/')) != NULL || (p1 = strchr(p2, '\\')) != NULL)
		{
			SERVER_NAME = ++p1;
			p2 = p1;
		}
		arg_c = argc;
		arg_v = argv;
	}

	malloc_init();// needed for Show* in display_title() [FlavioJS]

#ifdef MINICORE // minimalist Core
	display_title();
	usercheck();
	do_init(argc,argv);
	do_final();
#else// not MINICORE
	set_server_type();
	display_title();
	usercheck();

	db_init();
	signals_init();

	timer_init();
	socket_init();
	plugins_init();

	do_init(argc,argv);
	plugin_event_trigger(EVENT_ATHENA_INIT);

	{// Main runtime cycle
		int next;
		while (runflag != CORE_ST_STOP) {
			next = do_timer(gettick_nocache());
			do_sockets(next);
		}
	}

	plugin_event_trigger(EVENT_ATHENA_FINAL);
	do_final();

	timer_final();
	plugins_final();
	socket_final();
	db_final();
#endif

	malloc_final();

	return 0;
}
开发者ID:philg666,项目名称:Latest_eAmod,代码行数:60,代码来源:core.c


示例6: core_init

void core_init(void)
{
	dialog_type_queue = NULL;
	dialog_text_queue = NULL;
	client_start_time = time(NULL);

	modules_init();
	pidwait_init();

	net_disconnect_init();
	signals_init();

	signal_add_first("gui dialog", (SIGNAL_FUNC) sig_gui_dialog);
	signal_add_first("irssi init finished", (SIGNAL_FUNC) sig_init_finished);

	settings_init();
	commands_init();
	nickmatch_cache_init();
        session_init();
#ifdef HAVE_CAPSICUM
	capsicum_init();
#endif

	chat_protocols_init();
	chatnets_init();
        expandos_init();
	ignore_init();
	servers_init();
        write_buffer_init();
	log_init();
	log_away_init();
	rawlog_init();
	recode_init();

	channels_init();
	queries_init();
	nicklist_init();

	chat_commands_init();
	wcwidth_wrapper_init();

	settings_add_str("misc", "ignore_signals", "");
	settings_add_bool("misc", "override_coredump_limit", FALSE);

#ifdef HAVE_SYS_RESOURCE_H
	getrlimit(RLIMIT_CORE, &orig_core_rlimit);
#endif
	read_settings();
	signal_add("setup changed", (SIGNAL_FUNC) read_settings);
	signal_add("irssi init finished", (SIGNAL_FUNC) sig_irssi_init_finished);

	settings_check();

        module_register("core", "core");
}
开发者ID:ailin-nemui,项目名称:irssi,代码行数:55,代码来源:core.c


示例7: main

/*======================================
 *	CORE : MAINROUTINE
 *--------------------------------------*/
int main (int argc, char **argv)
{
	{
		// Inicializa os argumentos do programa
		char *p1 = SERVER_NAME = argv[0];
		char *p2 = p1;

		while ( (p1 = strchr (p2, '/')) != NULL || (p1 = strchr (p2, '\\')) != NULL)
		{
			SERVER_NAME = ++p1;
			p2 = p1;
		}

		arg_c = argc;
		arg_v = argv;
	}
	malloc_init(); // needed for Show* in display_title() [FlavioJS]
#ifndef _WIN32
	usercheck();
#endif
#ifdef MINICORE // minimalist Core
	display_title();
	do_init (argc, argv);
	do_final();
#else// not MINICORE
	set_server_type();	// Define o tipo de servidor (função exclusiva de cada servidor)
	display_title();	// Mostra o título
	db_init();
	signals_init();
#ifdef _WIN32
	cevents_init();
#endif
	timer_init();
	socket_init();
	do_init (argc, argv);	// Inicializa as funções do servidor
	{
		// Ciclo principal do servidor
		int next;

		// Enquanto a runflag não for a de Parar, o servidor rodará; do contrário, entrará em processo de finalização
		while (runflag != CORE_ST_STOP)
		{
			next = do_timer (gettick_nocache());
			do_sockets (next);
		}
	}
	do_final();
	timer_final();
	socket_final();
	db_final();
#endif
	malloc_final();
	return 0;
}
开发者ID:Zellukas,项目名称:Radices,代码行数:57,代码来源:core.c


示例8: core_init

void core_init(int argc, char *argv[])
{
	dialog_type_queue = NULL;
	dialog_text_queue = NULL;

	modules_init();
#ifndef WIN32
	pidwait_init();
#endif

	net_disconnect_init();
	net_sendbuffer_init();
	signals_init();

	signal_add_first("gui dialog", (SIGNAL_FUNC) sig_gui_dialog);
	signal_add_first("irssi init finished", (SIGNAL_FUNC) sig_init_finished);

	settings_init();
	commands_init();
	nickmatch_cache_init();
        session_init();

	chat_protocols_init();
	chatnets_init();
        expandos_init();
	ignore_init();
	servers_init();
        write_buffer_init();
	log_init();
	log_away_init();
	rawlog_init();
	recode_init();

	channels_init();
	queries_init();
	nicklist_init();

	chat_commands_init();

	settings_add_str("misc", "ignore_signals", "");
	settings_add_bool("misc", "override_coredump_limit", TRUE);

#ifdef HAVE_SYS_RESOURCE_H
	getrlimit(RLIMIT_CORE, &orig_core_rlimit);
#endif
	read_settings();
	signal_add("setup changed", (SIGNAL_FUNC) read_settings);
	signal_add("irssi init finished", (SIGNAL_FUNC) sig_irssi_init_finished);

	settings_check();

        module_register("core", "core");
}
开发者ID:svn2github,项目名称:irssi,代码行数:53,代码来源:core.c


示例9: main

int main (int argc, char **argv)
{
	int next;

	// initialise program arguments
	{
		char *p = SERVER_NAME = argv[0];
		while ((p = strchr(p, '/')) != NULL)
			SERVER_NAME = ++p;
		arg_c = argc;
		arg_v = argv;
	}

	set_server_type();
	display_title();
      usercheck();

	malloc_init(); /* 一番最初に実行する必要がある */
	db_init();
	signals_init();

	timer_init();
	socket_init();
	plugins_init();

	do_init(argc,argv);
	graph_init();
	plugin_event_trigger("Athena_Init");

	while (runflag) {
		next = do_timer(gettick_nocache());
		do_sendrecv(next);
#ifndef TURBO
		do_parsepacket();
#endif
	}

	plugin_event_trigger("Athena_Final");
	graph_final();
	do_final();

	timer_final();
	plugins_final();
	socket_final();
	db_final();
	malloc_final();

	return 0;
}
开发者ID:AxlSckay,项目名称:Ragnarok-OldTimes,代码行数:49,代码来源:core.c


示例10: core_init

void core_init(void)
{
	modules_init();
	pidwait_init();

	net_disconnect_init();
	signals_init();
	settings_init();
	commands_init();

	servers_init();
	log_init();
	rawlog_init();
	special_vars_init();
}
开发者ID:svn2github,项目名称:irssi,代码行数:15,代码来源:core.c


示例11: main

int main (int argc, char **argv)
{
	{// initialize program arguments
		char *p1 = SERVER_NAME = argv[0];
		char *p2 = p1;
		while ((p1 = strchr(p2, '/')) != NULL || (p1 = strchr(p2, '\\')) != NULL)
		{
			SERVER_NAME = ++p1;
			p2 = p1;
		}
		arg_c = argc;
		arg_v = argv;
	}

	malloc_init();
	set_server_type();
	display_title();
	usercheck();
	signals_init();
	timer_init();
	socket_init();

	do_init(argc,argv);

	{// Main runtime cycle
		int next;

		while (runflag) 
		{
			next = CTaskMgr::getInstance()->DoTimer(gettick_nocache());
			do_sockets(next);
		}
	}

	do_final();
	timer_final();
	socket_final();
	malloc_final();
	return 0;
}
开发者ID:fedaykinofdune,项目名称:ffxinfinity,代码行数:40,代码来源:kernel.cpp


示例12: main

int main (int argc, char **argv)
{
	{// initialize program arguments
		char *p1 = SERVER_NAME = argv[0];
		char *p2 = p1;
		while ((p1 = strchr(p2, '/')) != NULL || (p1 = strchr(p2, '\\')) != NULL)
		{
			SERVER_NAME = ++p1;
			p2 = p1;
		}
		arg_c = argc;
		arg_v = argv;
	}

    log_init(argc, argv);
	malloc_init();
	set_server_type();
	display_title();
	usercheck();
	signals_init();
	timer_init();
	socket_init();

	do_init(argc,argv);
	fd_set rfd;
	{// Main runtime cycle
		duration next;

		while (runflag) 
		{
            next = CTaskMgr::getInstance()->DoTimer(server_clock::now());
			do_sockets(&rfd,next);
		}
	}

    do_final(EXIT_SUCCESS);
	return 0;
}
开发者ID:LegionXI,项目名称:darkstar,代码行数:38,代码来源:kernel.cpp


示例13: main

int
main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv)
{
	g_thread_init(NULL);
	signals_init();
	io_thread_init();

	struct ntp_server ntp;
	ntp_server_init(&ntp);

	GError *error = NULL;
	if (!ntp_server_open(&ntp, &error)) {
		io_thread_deinit();
		g_printerr("%s\n", error->message);
		g_error_free(error);
		return EXIT_FAILURE;
	}

	io_thread_run();

	ntp_server_close(&ntp);
	io_thread_deinit();
	return EXIT_SUCCESS;
}
开发者ID:degifted,项目名称:MPD-with-support-for-FLAC-CUE-and--CUE-files-as-virtual-directories,代码行数:24,代码来源:run_ntp_server.c


示例14: main

int main(int argc, char **argv)
{
	int c, port = 2222, samplefreq = SAMPLEFREQ, chans = 2;
	int fmt_bits = 16;
	char *dev = "/dev/dsp";
	
	while((c = getopt(argc, argv, "+b:B:c:dhp:s:D:")) != EOF) {
		switch(c) {
			case 'b':
				buffer_size = atoi(optarg) * 1024;
				if(buffer_size < 16) {
					fprintf(stderr, "ERROR: buffer_size < 16\n");
					exit(1);
				}
				break;
			case 'c':
				chans = atoi(optarg);
				break;
			case 'd':
				debug++;
				break;
			case 'B':
				fmt_bits = atoi(optarg);
				if(fmt_bits != 16 && fmt_bits != 32) usage(1);
				break;
			case 'h':
				usage(0);
			case 'p':
				port = atoi(optarg);
				break;
			case 's':
				samplefreq = atoi(optarg);
				break;
			case 'D':
				dev = optarg;
				break;
			default:
				usage(1);
		}
	}

	buffer_init();
	input_start();
	output_init(dev, samplefreq, fmt_bits, chans);
	signals_init();
	socket_init(port);

	/* lock memory (limits for non-root can be raised in /etc/security/limits.conf) */
	if(mlockall(MCL_CURRENT | MCL_FUTURE) == -1) {
		struct rlimit rl;
		if(getrlimit(RLIMIT_MEMLOCK, &rl) == 0) {
			rl.rlim_cur = rl.rlim_max;
			if(setrlimit(RLIMIT_MEMLOCK, &rl) == -1) {
				perror("setrlimit RLIMIT_MEMLOCK");
			}
		}
		if(mlockall(MCL_CURRENT | MCL_FUTURE) == -1) {
			perror("warning: mlockall");
		}
	}

	/* realtime priority (limits for non-root can be raised in /etc/security/limits.conf) */
	struct sched_param sp;
	sp.sched_priority = 1;
	if(sched_setscheduler(getpid(), SCHED_FIFO, &sp) < 0)
		perror("sched_setscheduler");

	output_start();
	mainloop();

	return 0;
}
开发者ID:eric321,项目名称:soepkiptng,代码行数:72,代码来源:soepkiptng_play.c


示例15: main

/*======================================
 *	CORE : MAINROUTINE
 *--------------------------------------*/
int main (int argc, char **argv)
{
	{// Inicializa os argumentos do programa
		char *p1 = SERVER_NAME = argv[0];
		char *p2 = p1;
		while ((p1 = strchr(p2, '/')) != NULL || (p1 = strchr(p2, '\\')) != NULL)
		{
			SERVER_NAME = ++p1;
			p2 = p1;
		}
		arg_c = argc;
		arg_v = argv;
	}

// Não precisamos chamar o malloc_init se o Memory Manager não está ativo [Keoy]
#ifdef USE_MEMMGR
	malloc_init(); // needed for Show* in display_title() [FlavioJS]
#endif

#ifdef MINICORE // minimalist Core
	display_title();
	#ifndef _WIN32
		usercheck();
	#endif
	do_init(argc,argv);
	do_final();
#else// not MINICORE
	set_server_type();	// Define o tipo de servidor (função exclusiva de cada servidor)
	display_title();	// Mostra o título
	// Não precisamos verificar se estamos em root se não estamos em um sistema WIN32 [Keoy]
	#ifndef _WIN32
		usercheck();
	#endif
	db_init();
	signals_init();

	timer_init();
	socket_init();
	plugins_init();

	do_init(argc,argv);	// Inicializa as funções do servidor
	plugin_event_trigger(EVENT_ATHENA_INIT); // Evento inicial dos plugins

	{// Ciclo principal do servidor
		int next;
		// Enquanto a runflag for verdadeira (1) o servidor rodará, do contrário entrará em processo de finalização
		while (runflag) {
			next = do_timer(gettick_nocache());
			do_sockets(next);
		}
	}

	plugin_event_trigger(EVENT_ATHENA_FINAL); // Evento final dos plugins
	do_final();

	timer_final();
	plugins_final();
	socket_final();
	db_final();
#endif

// Não precisamos chamar o malloc_init se o Memory Manager não está ativo [Keoy]
#ifdef USE_MEMMGR
	malloc_final();
#endif

	return 0;
}
开发者ID:holdur,项目名称:oraculo,代码行数:71,代码来源:core.c


示例16: main


//.........这里部分代码省略.........
            if(setrlimit(RLIMIT_CORE, &rl) != 0)
                error("Cannot request unlimited core dumps for debugging... Proceeding anyway...");

#ifdef HAVE_SYS_PRCTL_H
            prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
#endif
        }


        // --------------------------------------------------------------------
        // get log filenames and settings

        log_init();
        error_log_limit_unlimited();


        // --------------------------------------------------------------------
        // load stream.conf
        {
            char filename[FILENAME_MAX + 1];
            snprintfz(filename, FILENAME_MAX, "%s/stream.conf", netdata_configured_config_dir);
            appconfig_load(&stream_config, filename, 0);
        }


        // --------------------------------------------------------------------
        // setup process signals

        // block signals while initializing threads.
        // this causes the threads to block signals.
        signals_block();

        // setup the signals we want to use
        signals_init();

        // setup threads configs
        default_stacksize = netdata_threads_init();


        // --------------------------------------------------------------------
        // check which threads are enabled and initialize them

        for (i = 0; static_threads[i].name != NULL ; i++) {
            struct netdata_static_thread *st = &static_threads[i];

            if(st->config_name)
                st->enabled = config_get_boolean(st->config_section, st->config_name, st->enabled);

            if(st->enabled && st->init_routine)
                st->init_routine();
        }


        // --------------------------------------------------------------------
        // get the user we should run

        // IMPORTANT: this is required before web_files_uid()
        if(getuid() == 0) {
            user = config_get(CONFIG_SECTION_GLOBAL, "run as user", NETDATA_USER);
        }
        else {
            struct passwd *passwd = getpwuid(getuid());
            user = config_get(CONFIG_SECTION_GLOBAL, "run as user", (passwd && passwd->pw_name)?passwd->pw_name:"");
        }

        // --------------------------------------------------------------------
开发者ID:Peoplecantfly,项目名称:netdata,代码行数:67,代码来源:main.c


示例17: main

int main(int argc, char **argv)
{
	struct sockaddr_ll from;
	socklen_t fromlen = sizeof(from);
	char *device = "eth0", *ps;
	uint8_t *buf, *p;
	int n, i, err=0;
	unsigned int len;
	struct sk_buff *skb;

	conf.ifindex=-1;
	conf.debug = 0;

	if(jelopt(argv, 'h', "help", NULL, &err)) {
		printf("econsole [DEV] [CONSOLE] [DESTMAC] [(scan|debug)]\n"); 
		exit(0);
	}
	argc = jelopt_final(argv, &err);
	if(err) {
		printf("Syntax error in arguments.\n");
		exit(2);
	}

	while(--argc > 0) {
		if(strcmp(argv[argc], "scan")==0) {
			printf("Scanning for econsoles\n");
			conf.scan = 1;
			continue;
		}
		if(strcmp(argv[argc], "debug")==0) {
			printf("Debug mode\n");
			conf.debug++;
			continue;
		}
		if( (strlen(argv[argc]) < 3) && isdigit(*argv[argc])) {
			conf.console = atoi(argv[argc]);
			continue;
		}
		if(strchr(argv[argc], ':' )) {
			unsigned int a;
			ps = argv[argc];
			for(i=0;i<6;i++) {
				sscanf(ps, "%x", &a);
				conf.dest.sll_addr[i] = a;
				ps = strchr(ps, ':');
				if(!ps) break;
				ps++;
			}
			conf.ucast = 1;
			continue;
		} else {
			device = argv[argc];
		}
	}
	
	conf.devsocket = devsocket();
	
	while(set_flag(device, (IFF_UP | IFF_RUNNING))) {
		printf("Waiting for interface to be available\n");
		sleep(1);
	}
	
	if(device)
	{
		conf.ifindex = if_nametoindex(device);
		if(!conf.ifindex)
		{
			fprintf(stderr, "no such device %s\n", device);
			exit(1);
		}
	}

	conf.s = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_EGETTY));
	if(conf.s == -1)
	{
		fprintf(stderr, "socket(): %s\n", strerror(errno));
		exit(1);
	}


	if(conf.ifindex >= 0)
	{
		struct sockaddr_ll addr;
		memset(&addr, 0, sizeof(addr));
		
		addr.sll_family = AF_PACKET;
		addr.sll_protocol = htons(ETH_P_EGETTY);
		addr.sll_ifindex = conf.ifindex;
		
		if(bind(conf.s, (const struct sockaddr *)&addr, sizeof(addr)))
		{
			fprintf(stderr, "bind failed: %s\n", strerror(errno));
			exit(1);
		}
	}

	if(!conf.scan) {
		terminal_settings();
		signals_init();
		winch_handler(0);
//.........这里部分代码省略.........
开发者ID:jelaas,项目名称:egetty,代码行数:101,代码来源:econsole.c


示例18: tcsd_startup

static TSS_RESULT
tcsd_startup(void)
{
	TSS_RESULT result;

#ifdef TSS_DEBUG
	/* Set stdout to be unbuffered to match stderr and interleave output correctly */
	setvbuf(stdout, (char *)NULL, _IONBF, 0);
#endif

	if ((result = signals_init()))
		return result;

	if ((result = conf_file_init(&tcsd_options)))
		return result;

	if ((result = tcsd_threads_init())) {
		conf_file_final(&tcsd_options);
		return result;
	}

	if ((result = req_mgr_init())) {
		conf_file_final(&tcsd_options);
		return result;
	}

	if ((result = ps_dirs_init())) {
		conf_file_final(&tcsd_options);
		(void)req_mgr_final();
		return result;
	}

	result = PS_init_disk_cache();
	if (result != TSS_SUCCESS) {
		conf_file_final(&tcsd_options);
		(void)req_mgr_final();
		return result;
	}

	if ((result = get_tpm_metrics(&tpm_metrics))) {
		conf_file_final(&tcsd_options);
		PS_close_disk_cache();
		(void)req_mgr_final();
		return result;
	}

	/* must happen after get_tpm_metrics() */
	if ((result = auth_mgr_init())) {
		conf_file_final(&tcsd_options);
		PS_close_disk_cache();
		(void)req_mgr_final();
		return result;
	}

	result = EVENT_LOG_init();
	if (result != TSS_SUCCESS) {
		auth_mgr_final();
		conf_file_final(&tcsd_options);
		PS_close_disk_cache();
		(void)req_mgr_final();
		return result;
	}

	result = owner_evict_init();
	if (result != TSS_SUCCESS) {
		auth_mgr_final();
		conf_file_final(&tcsd_options);
		PS_close_disk_cache();
		(void)req_mgr_final();
		return result;
	}

	return TSS_SUCCESS;
}
开发者ID:cooljeanius,项目名称:trousers-0.3.11.2,代码行数:74,代码来源:svrside.c


示例19: do_connection


//.........这里部分代码省略.........
			break;
#endif
		case 'g':
			from_scratch = true;
			break;
		case 'i':
			initialize_only = true;
			from_scratch = true;
			foreground = true;
			break;
		case 'o':
			write_transaction_file = true;
			break;
		case 'B':
			backup_notifier = 1;
			break;
		default:
			usage();
			exit(1);
		}
	}

	if (asprintf(&f, "%s/bad_cache", cache_dir) < 0) abort();
	if (stat(f, &stbuf) == 0) {
		exit(3);
	}
	free(f);

	univention_debug_set_level(UV_DEBUG_LISTENER, debugging);
	univention_debug_set_level(UV_DEBUG_LDAP, debugging);
	univention_debug_set_level(UV_DEBUG_KERBEROS, debugging);

	snprintf(pidfile, PATH_MAX, "%s/pid", cache_dir);
	signals_init();

	if (!foreground && daemonize() != 0)
		exit(EXIT_FAILURE);

	drop_privileges();

	if (from_scratch)
		purge_cache(cache_dir);

	prepare_cache(cache_dir);

	/* choose server to connect to */
	if (lp->host == NULL && lp->uri == NULL) {
		select_server(lp);
		univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_INFO,
				"no server given, choosing one by myself (%s)",
				lp->host);
	}

#ifdef WITH_KRB5
	if (!do_kinit)
		kp = NULL;
	if (kp != NULL && univention_krb5_init(kp) != 0) {
		univention_debug(UV_DEBUG_KERBEROS, UV_DEBUG_ERROR, "kinit failed");
		exit(1);
	}
#endif

	while (do_connection(lp) != 0) {
		univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_WARN, "can not connect to ldap server %s:%d", lp->host, lp->port);
		if (suspend_connect()) {
			if (initialize_only) {
开发者ID:B-Rich,项目名称:smart,代码行数:67,代码来源:main.c


示例20: main


//.........这里部分代码省略.........
				puts("                 Multiple -d options are allowed.");
				puts("  -s<mod>        Use sound module <sys>:");
				for (i = 0; i < (int)N_ELEMENTS(sound_modules); i++)
					printf("     %s   %s\n", sound_modules[i].name,
					       sound_modules[i].help);
				puts("  -m<sys>        Use module <sys>, where <sys> can be:");

				/* Print the name and help for each available module */
				for (i = 0; i < (int)N_ELEMENTS(modules); i++)
					printf("     %s   %s\n",
					       modules[i].name, modules[i].help);

				/* Actually abort the process */
				quit(NULL);
		}
		if (*arg) goto usage;
	}

	/* Hack -- Forget standard args */
	if (args) {
		argc = 1;
		argv[1] = NULL;
	}

	/* Install "quit" hook */
	quit_aux = quit_hook;

	/* If we were told which mode to use, then use it */
	if (mstr)
		ANGBAND_SYS = mstr;

	if (setlocale(LC_CTYPE, "")) {
		/* Require UTF-8 */
		if (strcmp(nl_langinfo(CODESET), "UTF-8") != 0)
			quit("Angband requires UTF-8 support");
	}

	/* Try the modules in the order specified by modules[] */
	for (i = 0; i < (int)N_ELEMENTS(modules); i++) {
		/* User requested a specific module? */
		if (!mstr || (streq(mstr, modules[i].name))) {
			ANGBAND_SYS = modules[i].name;
			if (0 == modules[i].init(argc, argv)) {
				done = TRUE;
				break;
			}
		}
	}

	/* Make sure we have a display! */
	if (!done) quit("Unable to prepare any 'display module'!");

#ifdef UNIX

	/* Get the "user name" as default player name, unless set with -u switch */
	if (!op_ptr->full_name[0]) {
		user_name(op_ptr->full_name, sizeof(op_ptr->full_name), player_uid);

		/* Set the savefile to load */
		savefile_set_name(player_safe_name(player, FALSE));
	}

	/* Create any missing directories */
	create_needed_dirs();

#endif /* UNIX */

	/* Try the modules in the order specified by sound_modules[] */
	for (i = 0; i < (int)N_ELEMENTS(sound_modules); i++)
		if (!soundstr || streq(soundstr, sound_modules[i].name))
			if (0 == sound_modules[i].init(argc, argv))
				break;

	/* Catch nasty signals */
	signals_init();

	/* Set up the command hook */
	cmd_get_hook = textui_get_cmd;

	/* Set up the display handlers and things. */
	init_display();
	init_angband();
	textui_init();

	/* Wait for response */
	pause_line(Term);

	/* Play the game */
	play_game(new_game);

	/* Free resources */
	textui_cleanup();
	cleanup_angband();

	/* Quit */
	quit(NULL);

	/* Exit */
	return (0);
}
开发者ID:NickMcConnell,项目名称:FirstAgeAngband,代码行数:101,代码来源:main.c



注:本文中的signals_init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sigorsets函数代码示例发布时间:2022-05-30
下一篇:
C++ signalfd_cleanup函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap