CO-CODE Hugo-Luke

+ signals handling adjusted
+ wait_subshell() with last_exit_status
+ miscs
This commit is contained in:
LuckyLaszlo
2021-11-17 01:35:06 +01:00
parent 965cf99ca5
commit 26993144cc
8 changed files with 185 additions and 128 deletions

View File

@@ -6,31 +6,24 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/23 18:56:53 by lperrey #+# #+# */
/* Updated: 2021/11/15 20:08:26 by hulamy ### ########.fr */
/* Updated: 2021/11/16 22:58:29 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
void sigint_handler_interactiv(int signum)
void sigint_handler_interactive(int signum)
{
(void)signum;
write(1, "\n", 1);
rl_replace_line("", 1);
rl_on_new_line();
rl_replace_line("", 1);
rl_redisplay();
}
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_interactiv;
signal_behaviour->sa_handler = sigint_handler_interactive;
sigaction(SIGINT, signal_behaviour, NULL);
signal_behaviour->sa_handler = SIG_IGN;
sigaction(SIGQUIT, signal_behaviour, NULL);