still working on memory stuff

This commit is contained in:
Maieul BOYER 2024-05-08 19:35:13 +02:00
parent 8e90a858ad
commit 326c9318e4
No known key found for this signature in database
18 changed files with 206 additions and 77 deletions

View file

@ -6,16 +6,16 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 13:22:14 by maiboyer #+# #+# */
/* Updated: 2024/05/08 15:33:52 by maiboyer ### ########.fr */
/* Updated: 2024/05/08 18:20:46 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "app/signal_handler.h"
#include "me/printf/printf.h"
#include "me/types.h"
#include "readline/readline.h"
#include "me/printf/printf.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
void sigint_handle(int sig, siginfo_t *info, void *ucontext)
{
@ -56,7 +56,7 @@ void sigsegv_handle(int sig, siginfo_t *info, void *ucontext)
(void)(sig);
(void)(info);
(void)(ucontext);
me_eprintf("SEGFAULT!!!\n");
me_eprintf("Abort: SEGFAULT!!!\n");
print_trace();
exit(139);
}
@ -74,9 +74,9 @@ 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);
return (NO_ERROR);
}