update
This commit is contained in:
parent
6d83a2c196
commit
b1cfc0ee71
31 changed files with 133 additions and 89 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/02 13:22:14 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/05/09 21:31:42 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/05/23 17:07:03 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -19,36 +19,24 @@
|
|||
|
||||
void sigint_handle(int sig, siginfo_t *info, void *ucontext)
|
||||
{
|
||||
static int count = 0;
|
||||
(void)(sig);
|
||||
(void)(info);
|
||||
(void)(ucontext);
|
||||
count++;
|
||||
printf("\n");
|
||||
rl_replace_line("", 0);
|
||||
rl_on_new_line();
|
||||
rl_redisplay();
|
||||
if (count == 10)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void sigquit_handle(int sig, siginfo_t *info, void *ucontext)
|
||||
{
|
||||
static int count = 0;
|
||||
(void)(sig);
|
||||
(void)(info);
|
||||
(void)(ucontext);
|
||||
count++;
|
||||
printf("\n");
|
||||
rl_replace_line("", 0);
|
||||
rl_on_new_line();
|
||||
rl_redisplay();
|
||||
if (count == 10)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void sigsegv_handle(int sig, siginfo_t *info, void *ucontext)
|
||||
|
|
@ -74,7 +62,7 @@ t_error install_signal(void)
|
|||
data.sa_sigaction = sigquit_handle;
|
||||
if (sigaction(SIGQUIT, &data, NULL))
|
||||
return (ERROR);
|
||||
|
||||
|
||||
// data.sa_sigaction = sigsegv_handle;
|
||||
// if (sigaction(SIGSEGV, &data, NULL))
|
||||
// return (ERROR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue