예제 #1
0
파일: hook_init.c 프로젝트: sbenning42/42
static void				sig_handler(int signum)
{
    if (signum == SIGINT)
    {
        if (hook_close())
            exit(EXIT_FAILURE);
        exit(EXIT_SUCCESS);
    }
    else if (signum == SIGCONT)
    {
        if (hook_open())
            exit(EXIT_FAILURE);
    }
}
예제 #2
0
static int hook_fabric_close(struct fid *fid)
{
	struct hook_fabric *fab;

	fab = container_of(fid, struct hook_fabric, fabric.fid);
	switch (fab->hclass) {
	case HOOK_PERF:
		hook_perf_destroy(fab);
		break;
	default:
		break;
	}
	return hook_close(fid);
}
예제 #3
0
파일: main.c 프로젝트: sbenning42/42
int					main(int arg_c, char **arg_v, char **env_p)
{
	t_hook_input	hook;
	char			*input;

	if (hook_open(&hook))
		exit(EXIT_FAILURE);
	input = hook_input(&hook);
	ft_printf("[%s]\n", input);
	if (hook_close(&hook))
		exit(EXIT_FAILURE);
	return (0);
	(void)arg_c;
	(void)arg_v;
	(void)env_p;
}