From 67e8a6042395bef97d4817581213f9d9bde000f0 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Tue, 28 Mar 2023 14:38:10 +0200 Subject: [PATCH] fix: signal set exit code --- main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index a272c4f..786ebd7 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ /* By: cchauvet exit_code = 130; if (*ft_get_heredoc() != -1) { close(*ft_get_heredoc()); @@ -106,10 +110,8 @@ void ft_ctrlc(int num) } else { - data = ft_get_data(); if (data->child_pid > 1) { - kill(data->child_pid, num); data->child_pid = 0; ft_putchar_fd('\n', 1); } @@ -127,10 +129,11 @@ void ft_quit(int num) { t_data *data; + (void) num; data = ft_get_data(); + data->exit_code = 131; if (data->child_pid > 1) { - kill(data->child_pid, num); ft_printf("Quit (core dumped)\n"); data->child_pid = 0; }