Fix: Working on XeMaix

This commit is contained in:
Maix0 2024-05-03 12:51:48 +02:00
parent 0e2ec315b9
commit 4cf245dd13
2 changed files with 5 additions and 2 deletions

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */ /* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 13:20:25 by maiboyer #+# #+# */ /* Created: 2024/05/02 13:20:25 by maiboyer #+# #+# */
/* Updated: 2024/05/02 13:23:06 by maiboyer ### ########.fr */ /* Updated: 2024/05/03 12:18:29 by maiboyer ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,6 +14,7 @@
#define SIGNAL_HANDLER_H #define SIGNAL_HANDLER_H
#include "me/types.h" #include "me/types.h"
#include <stdio.h>
#include <readline/readline.h> #include <readline/readline.h>
#include <signal.h> #include <signal.h>

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */ /* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 13:22:14 by maiboyer #+# #+# */ /* Created: 2024/05/02 13:22:14 by maiboyer #+# #+# */
/* Updated: 2024/05/02 14:00:31 by maiboyer ### ########.fr */ /* Updated: 2024/05/03 12:23:44 by maiboyer ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,6 +14,7 @@
#include "me/types.h" #include "me/types.h"
#include "readline/readline.h" #include "readline/readline.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
void sigint_handle(int sig, siginfo_t *info, void *ucontext) void sigint_handle(int sig, siginfo_t *info, void *ucontext)
{ {
@ -53,6 +54,7 @@ t_error install_signal(void)
{ {
struct sigaction data; struct sigaction data;
data = (struct sigaction){};
data.sa_sigaction = sigint_handle; data.sa_sigaction = sigint_handle;
data.sa_flags = SA_SIGINFO | SA_NOCLDWAIT; data.sa_flags = SA_SIGINFO | SA_NOCLDWAIT;
if (sigaction(SIGINT, &data, NULL)) if (sigaction(SIGINT, &data, NULL))