42_minishell/signal/signal.c
2023-04-17 12:16:41 +00:00

37 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* signal.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/28 15:59:01 by cchauvet #+# #+# */
/* Updated: 2023/04/17 11:23:21 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "signal_private.h"
void ft_ctrlc_heredoc(int num)
{
close(0);
ft_putchar_fd('\n', 1);
(void) num;
}
void ft_ctrlc(int num)
{
rl_replace_line("", 0);
rl_on_new_line();
ft_putchar_fd('\n', 1);
rl_redisplay();
*ft_get_exit_code() = 130;
(void) num;
}
void ft_quit(int num)
{
(void) num;
ft_printf("Quit (core dumped)\n");
}