mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-05-11 06:58:47 +02:00
「🔨」 fix(exec/exec_cmd): fixed sigpipe leaks when forked :D
This commit is contained in:
33
src/exec/sigpipe.c
Normal file
33
src/exec/sigpipe.c
Normal file
@ -0,0 +1,33 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* sigpipe.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/13 18:23:24 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/08/13 18:40:19 by mmoussou ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
#include "builtins.h"
|
||||
|
||||
char **get_env_arr(char **env)
|
||||
{
|
||||
static char **ret;
|
||||
|
||||
if (env)
|
||||
ret = env;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void sig_p(int code)
|
||||
{
|
||||
t_env **env;
|
||||
|
||||
(void) code;
|
||||
env = get_env(NULL);
|
||||
free_exit(*env, get_env_arr(NULL));
|
||||
exit(141);
|
||||
}
|
Reference in New Issue
Block a user