42_minishell/signal/signal.c

37 lines
1.2 KiB
C
Raw Permalink Normal View History

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