summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/b_sqb_file.c8
1 files changed, 2 insertions, 6 deletions
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