mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 19:36:50 +01:00
37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* sig.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2024/07/16 14:38:11 by adjoly #+# #+# */
|
||
|
/* Updated: 2024/07/16 14:38:58 by adjoly ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "minishell.h"
|
||
|
|
||
|
void ign(int signal)
|
||
|
{
|
||
|
(void) signal;
|
||
|
}
|
||
|
|
||
|
void __sig2(int status)
|
||
|
{
|
||
|
if (WIFSIGNALED(status) && WTERMSIG(status) == SIGQUIT)
|
||
|
{
|
||
|
get_exit_code(131);
|
||
|
if (WCOREDUMP(status))
|
||
|
ft_putendl_fd("Quit (core dumped)", 2);
|
||
|
else
|
||
|
ft_putendl_fd("Quit", 2);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void __sig(void)
|
||
|
{
|
||
|
signal(SIGQUIT, ign);
|
||
|
signal(SIGINT, ign);
|
||
|
}
|