mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
fix(connec_cmd): handle nested connections correctly
This commit is contained in:
parent
92d647e33c
commit
65c1eb9d84
4 changed files with 20 additions and 20 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/04/11 12:01:29 by khais #+# #+# */
|
||||
/* Updated: 2025/04/16 16:56:55 by khais ### ########.fr */
|
||||
/* Updated: 2025/04/28 15:04:17 by khais ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -46,8 +46,7 @@ static void close_and_wait(t_minishell *app, int pid1, int pid2, int pipefd[2])
|
|||
do_waitpid(app, pid2);
|
||||
}
|
||||
|
||||
void connec_pipe_cmd_execute(t_connec_cmd *cmd, t_minishell *app,
|
||||
bool should_exit)
|
||||
void connec_pipe_cmd_execute(t_connec_cmd *cmd, t_minishell *app)
|
||||
{
|
||||
int pid1;
|
||||
int pid2;
|
||||
|
|
@ -69,9 +68,5 @@ void connec_pipe_cmd_execute(t_connec_cmd *cmd, t_minishell *app,
|
|||
cmd_execute(cmd->second, app, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
close_and_wait(app, pid1, pid2, pipefd);
|
||||
if (should_exit)
|
||||
exit(app->last_return_value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue