summaryrefslogtreecommitdiff
path: root/filesystem-posix.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-10-28 13:28:18 -0400
committerpommicket <pommicket@gmail.com>2022-10-28 13:28:18 -0400
commitaf6a9c5552d3bd4e708d644cc47e4be4ca2edaf8 (patch)
tree700fa3006babc185018b9ac49cdec90dbce50cb9 /filesystem-posix.c
parent67beb21c710509acdb11017a77805ec57676e666 (diff)
fixed rust '\\' highlighting, among other things
Diffstat (limited to 'filesystem-posix.c')
-rw-r--r--filesystem-posix.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/filesystem-posix.c b/filesystem-posix.c
index 6a52732..5506278 100644
--- a/filesystem-posix.c
+++ b/filesystem-posix.c
@@ -22,10 +22,9 @@ FsType fs_path_type(char const *path) {
}
FsPermission fs_path_permission(char const *path) {
- int bits = access(path, R_OK | W_OK);
FsPermission perm = 0;
- if (!(bits & R_OK)) perm |= FS_PERMISSION_READ;
- if (!(bits & W_OK)) perm |= FS_PERMISSION_WRITE;
+ if (access(path, R_OK) == 0) perm |= FS_PERMISSION_READ;
+ if (access(path, W_OK) == 0) perm |= FS_PERMISSION_WRITE;
return perm;
}