Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
fix dirfd behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nicknamemohaji committed Apr 15, 2024
1 parent 6c467d2 commit 5969608
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codes/loader/ldexec_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: kyungjle <kyungjle@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/14 01:11:55 by nicknamemoh #+# #+# */
/* Updated: 2024/04/15 18:09:27 by kyungjle ### ########.fr */
/* Updated: 2024/04/15 18:14:41 by kyungjle ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -72,7 +72,7 @@ static void close_fds(void)
while (ent != NULL)
{
fd = ft_atoi(ent->d_name);
if (fd > 2 && fd != dir->__dd_fd)
if (fd > 2 && fd != *(int *) dir)
close(fd);
ent = readdir(dir);
}
Expand Down

0 comments on commit 5969608

Please sign in to comment.