ft_printfd_fd -> fprintf

This commit is contained in:
2024-04-18 17:57:17 +02:00
parent be46825893
commit 9053276342
11 changed files with 49 additions and 49 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */
/* Updated: 2024/04/18 17:22:28 by marde-vr ### ########.fr */
/* Updated: 2024/04/18 17:56:05 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,15 +16,15 @@ void redirect_input(t_msh *msh, int i)
{
if (msh->in_type != PIPE)
{
ft_printf_fd(2, "redirecting input\n");
fprintf(stderr, "redirecting input\n");
if (dup2(msh->in_fd, 0) < 0)
ft_exit(msh, 1);
close(msh->in_fd);
}
else
{
ft_printf_fd(2, "redirecting pipe input\n");
ft_printf_fd(2, "input of cmd %d: 0 -> %d\n", i, msh->fds[i - 1][0]);
fprintf(stderr, "redirecting pipe input\n");
fprintf(stderr, "input of cmd %d: 0 -> %d\n", i, msh->fds[i - 1][0]);
if (dup2(msh->fds[i - 1][0], 0) < 0)
{
perror("dup2"); //debug
@ -50,7 +50,7 @@ void open_input_file(t_msh *msh, t_cmd **cur_token)
free_token(filename);
if (msh->in_fd == -1 && !g_return_code)
{
ft_printf_fd(2, "minishell: %s: ", (*cur_token)->next->value);
fprintf(stderr, "minishell: %s: ", (*cur_token)->next->value);
perror("");
g_return_code = 1;
}