Amélioration nom bonus pipex.c

This commit is contained in:
Etienne Rey-bethbeder 2023-03-08 19:16:45 +01:00
parent 5b3f57421a
commit 1291269706

View file

@ -6,7 +6,7 @@
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */ /* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/18 18:04:58 by erey-bet #+# #+# */ /* Created: 2023/01/18 18:04:58 by erey-bet #+# #+# */
/* Updated: 2023/03/08 14:34:26 by erey-bet ### ########.fr */ /* Updated: 2023/03/08 19:16:14 by erey-bet ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -44,7 +44,7 @@ void choice_cmd(t_data data, int i)
exit(1); exit(1);
} }
int pipex_loop(int argc, int **fk, t_data data) int pipex_loop(int argc, int **forks, t_data data)
{ {
int i; int i;
@ -55,10 +55,10 @@ int pipex_loop(int argc, int **fk, t_data data)
return (1); return (1);
if ((i > 0 || (i == 0 && data.fd1 > 0)) && data.cmds[i]) if ((i > 0 || (i == 0 && data.fd1 > 0)) && data.cmds[i])
{ {
(*fk)[i] = fork(); (*forks)[i] = fork();
if ((*fk)[i] < 0) if ((*forks)[i] < 0)
return (1); return (1);
if ((*fk)[i] == 0) if ((*forks)[i] == 0)
choice_cmd(data, i); choice_cmd(data, i);
} }
if (i > 0) if (i > 0)