42_minishell/signal/signal.c

38 lines
1.2 KiB
C
Raw 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 06:41:54 -04:00
/* Updated: 2023/04/17 10:39:36 by cchauvet ### ########.fr */
2023-03-29 13:07:57 -04:00
/* */
/* ************************************************************************** */
#include "signal_private.h"
2023-04-05 11:32:04 -04:00
void ft_ctrlc(int num)
2023-03-29 13:07:57 -04:00
{
if (*ft_get_heredoc() != -1)
{
close(*ft_get_heredoc());
*ft_get_heredoc() = -1;
}
else
{
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
}