Skip to content

Commit

Permalink
fix on "cat < doesnotexist". Send error now
Browse files Browse the repository at this point in the history
  • Loading branch information
izzypt committed Aug 12, 2023
1 parent 8715750 commit 055418a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions executor/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* ::: :::::::: */
/* input.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: esali <esali@student.42.fr> +#+ +:+ +#+ */
/* By: simao <simao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/07 13:23:28 by simao #+# #+# */
/* Updated: 2023/08/12 16:58:07 by esali ### ########.fr */
/* Updated: 2023/08/12 23:14:00 by simao ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -31,7 +31,11 @@ void input_from_fd(t_list *node)
int in;

in = open(node->next->next->token[0], O_RDONLY, 0644);
ft_printf("Opened fd is %d\n", in);
if (in == -1)
{
write(2, "No such file or directory\n", 27);
return ;
}
get_data()->executing_cmd = 1;
exec_input(node, in);
}

0 comments on commit 055418a

Please sign in to comment.