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

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
	fix error at write redirection, not cleating file error.
  • Loading branch information
Dohoon Gwak committed Apr 5, 2024
1 parent 370bd00 commit fa125e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codes/loader/ldpre_ast_redir.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* ::: :::::::: */
/* ldpre_ast_redir.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kyungjle <kyungjle@student.42.fr> +#+ +:+ +#+ */
/* By: dogwak <dogwak@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/04 18:41:08 by kyungjle #+# #+# */
/* Updated: 2024/04/04 18:50:49 by kyungjle ### ########.fr */
/* Updated: 2024/04/05 12:12:10 by dogwak ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -25,7 +25,7 @@ t_bool ldpre_ast_redir_outfile(char *filename, enum e_node_type mode)
{
int fd;

if (access(filename, F_OK) && access(filename, F_OK | W_OK) != 0)
if (!access(filename, F_OK) && access(filename, F_OK | W_OK) != 0)
return (ld_errno_file("ldpre_ast_redir_outfile.access", filename));
close(STDOUT_FD);
if (mode == EXP_PRE_RWRITE)
Expand Down

0 comments on commit fa125e9

Please sign in to comment.