gestion des signaux avec execve ok dans test

This commit is contained in:
hugogogo
2021-11-15 21:56:50 +01:00
parent 57c271b9e2
commit 36766501ba
5 changed files with 51 additions and 8 deletions

View File

@@ -6,25 +6,31 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/23 18:56:53 by lperrey #+# #+# */
/* Updated: 2021/11/10 13:44:09 by hulamy ### ########.fr */
/* Updated: 2021/11/15 20:08:26 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void sigint_handler(int signum)
void sigint_handler_interactiv(int signum)
{
(void)signum;
write(1, "\n", 1);
rl_replace_line("", 1);
rl_on_new_line();
rl_redisplay();
return ;
}
void sigint_handler_execution(int signum)
{
(void)signum;
write(1, "\n", 1);
// exit(0);
}
int set_signals_handling(struct sigaction *signal_behaviour)
{
signal_behaviour->sa_handler = sigint_handler;
signal_behaviour->sa_handler = sigint_handler_interactiv;
sigaction(SIGINT, signal_behaviour, NULL);
signal_behaviour->sa_handler = SIG_IGN;
sigaction(SIGQUIT, signal_behaviour, NULL);