示例#1
0
文件: main.c 项目: tohojo/http-getter
static void sig_exit(int signal)
{
	kill_workers();
	if(signal == SIGINT) print_stats(opt.output);
	destroy_options(&opt);
	if(signal == SIGINT) {
		sigaction(SIGINT, &sigdfl, NULL);
		kill(getpid(), SIGINT);
	}
	exit(signal);
}
示例#2
0
文件: main.c 项目: tohojo/http-getter
int main(int argc, char **argv)
{
	int ret;
	if(sigaction(SIGINT, &sigact, NULL) < 0 ||
		sigaction(SIGTERM, &sigact, NULL) < 0) {
		perror("Error installing signal handler");
		return 1;
	}

	if(initialise_options(&opt, argc, argv) < 0)
		return 1;

	ret = get_loop(&opt);

	destroy_options(&opt);
	return ret;

}
示例#3
0
int
main (int argc, char **argv)
{
  int i;
  set_options (argc, argv);
  if (exercises_executor (argc, argv))
    return;
  instance_t instance_type = input_type (argc, argv);
  algorithm_t alg_type = algorithm_type (argc, argv); /*
  if (!feof (stdin)) TODO Not working
    return; */
  if (instance_type == taillard)
    for (i = 0; i < TAILLARD_N_INSTANCES; i++)
      fetch_execute (stdin, instance_type, alg_type);
  else
    fetch_execute (stdin, instance_type, alg_type);
  destroy_options ();
}