mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 11:26:51 +01:00
「🏗️」 wip: try to fix ctrl \ in cat
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/06/01 14:55:06 by mmoussou #+# #+# */
|
/* Created: 2024/06/01 14:55:06 by mmoussou #+# #+# */
|
||||||
/* Updated: 2024/07/15 14:35:30 by adjoly ### ########.fr */
|
/* Updated: 2024/07/15 15:23:24 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -15,7 +15,7 @@
|
|||||||
#include "error_msg.h"
|
#include "error_msg.h"
|
||||||
#include "execution.h"
|
#include "execution.h"
|
||||||
|
|
||||||
void __sig(void);
|
void __sig(int status);
|
||||||
|
|
||||||
void exec_cmd(char *cmd, char **argv, char **env, t_env *env_t)
|
void exec_cmd(char *cmd, char **argv, char **env, t_env *env_t)
|
||||||
{
|
{
|
||||||
@ -112,7 +112,7 @@ t_exec exec_pipe(t_exec exec, t_list *list_cmd, t_env *env)
|
|||||||
}
|
}
|
||||||
exec.status = exec_single_cmd(list_cmd->content, exec.env_array, \
|
exec.status = exec_single_cmd(list_cmd->content, exec.env_array, \
|
||||||
env, exec.pipe_fd);
|
env, exec.pipe_fd);
|
||||||
__sig();
|
__sig(exec.status);
|
||||||
if (((t_cmd *)(list_cmd->content))->outfile != STDOUT_FILENO)
|
if (((t_cmd *)(list_cmd->content))->outfile != STDOUT_FILENO)
|
||||||
close(((t_cmd *)(list_cmd->content))->outfile);
|
close(((t_cmd *)(list_cmd->content))->outfile);
|
||||||
if (((t_cmd *)(list_cmd->content))->infile != STDIN_FILENO)
|
if (((t_cmd *)(list_cmd->content))->infile != STDIN_FILENO)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/07/09 22:53:01 by adjoly #+# #+# */
|
/* Created: 2024/07/09 22:53:01 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/07/15 14:32:40 by adjoly ### ########.fr */
|
/* Updated: 2024/07/15 15:23:00 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -37,8 +37,16 @@ int send_error_exec(char *input)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void __sig(void)
|
void __sig(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);
|
||||||
|
}
|
||||||
signal(SIGQUIT, SIG_IGN);
|
signal(SIGQUIT, SIG_IGN);
|
||||||
signal(SIGINT, SIG_IGN);
|
signal(SIGINT, SIG_IGN);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user