From 0cdd4719ca55e1084c37c7dab192ceb4e277650c Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 26 Aug 2020 16:30:22 +0200 Subject: in progress --- src/b_sqb_file.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/b_sqb_file.c') diff --git a/src/b_sqb_file.c b/src/b_sqb_file.c index 02ad601..d876516 100644 --- a/src/b_sqb_file.c +++ b/src/b_sqb_file.c @@ -38,7 +38,7 @@ static t_bool return (TRUE); else if (id == FT_ID_SQB_R && access(path, R_OK) == 0) return (TRUE); - else if (id == FT_ID_SQB_S && st->st_size != 0) + else if (id == FT_ID_SQB_S && st->st_size > 0) return (TRUE); else if (id == FT_ID_SQB_W && access(path, W_OK) == 0) return (TRUE); @@ -56,14 +56,10 @@ uint8_t struct stat st; int32_t fd; - if ((fd = open(argv[1], O_RDONLY)) == -1) + if (access(argv[1], 0) == -1) return (1); if (id == FT_ID_SQB_E) - { - close(fd); return (0); - } - close(fd); if (id == FT_ID_SQB_H || id == FT_ID_SQB_L_MAJ) lstat(argv[1], &st); else -- cgit v1.2.3