summaryrefslogtreecommitdiffstats
path: root/src/bftw.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-17 16:10:00 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-05-17 17:46:16 -0400
commitcf9230659e8d64e95209a4d57cbda8a474049ddb (patch)
tree8df76d6a165473a26f08dbfea9da5ad442460073 /src/bftw.c
parent23e048793401900c8d1768b4ffb0fc4ff623ef3e (diff)
downloadbfs-cf9230659e8d64e95209a4d57cbda8a474049ddb.tar.xz
Cast AT_FDCWD to int for comparisons
Some platforms define AT_FDCWD to a constant like 0xFFFAFDCD that gets typed as an unsigned int.
Diffstat (limited to 'src/bftw.c')
-rw-r--r--src/bftw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bftw.c b/src/bftw.c
index c4d3c17..5322181 100644
--- a/src/bftw.c
+++ b/src/bftw.c
@@ -1281,7 +1281,7 @@ static int bftw_pin_parent(struct bftw_state *state, struct bftw_file *file) {
int fd = parent->fd;
if (fd < 0) {
- bfs_static_assert(AT_FDCWD != -1);
+ bfs_static_assert((int)AT_FDCWD != -1);
return -1;
}
@@ -1298,7 +1298,7 @@ static int bftw_ioq_opendir(struct bftw_state *state, struct bftw_file *file) {
}
int dfd = bftw_pin_parent(state, file);
- if (dfd < 0 && dfd != AT_FDCWD) {
+ if (dfd < 0 && dfd != (int)AT_FDCWD) {
goto fail;
}
@@ -1450,7 +1450,7 @@ static int bftw_ioq_stat(struct bftw_state *state, struct bftw_file *file) {
}
int dfd = bftw_pin_parent(state, file);
- if (dfd < 0 && dfd != AT_FDCWD) {
+ if (dfd < 0 && dfd != (int)AT_FDCWD) {
goto fail;
}