For piping/redirections of built-in functions the STD_FILENOs
are supposed to be dupped and saved. But the STDIN was dupped
3 times instead of each of STDIN, STDOUT, STDERR being dupped once.
/* By: lnikolov <lnikolov@student.42prague.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/21 08:57:54 by ljiriste #+# #+# */
-/* Updated: 2024/08/27 15:29:43 by ljiriste ### ########.fr */
+/* Updated: 2024/08/29 11:19:20 by lnikolov ### ########.fr */
/* */
/* ************************************************************************** */
fds[0] = dup(STDIN_FILENO);
if (fds[0] < 0)
return (1);
- fds[1] = dup(STDIN_FILENO);
+ fds[1] = dup(STDOUT_FILENO);
if (fds[1] < 0)
{
close(fds[0]);
return (1);
}
- fds[2] = dup(STDIN_FILENO);
+ fds[2] = dup(STDERR_FILENO);
if (fds[2] < 0)
{
close(fds[0]);