summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-08-28 11:09:15 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-08-28 15:35:47 -0400
commitc125f8071b42142fc4f072b7222ace75bdadd726 (patch)
treeb32111bb93316b235c312f997fa6bee0adb48b6b /src
parentf958851578855e640c63a6d9b3ac637cb65320f8 (diff)
downloadbfs-c125f8071b42142fc4f072b7222ace75bdadd726.tar.xz
bftw: Handle a hypothetical platform where AT_FDCWD == -1
Diffstat (limited to 'src')
-rw-r--r--src/bftw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bftw.c b/src/bftw.c
index bb155a4..11c4825 100644
--- a/src/bftw.c
+++ b/src/bftw.c
@@ -1281,8 +1281,8 @@ static int bftw_pin_parent(struct bftw_state *state, struct bftw_file *file) {
int fd = parent->fd;
if (fd < 0) {
- bfs_static_assert((int)AT_FDCWD != -1);
- return -1;
+ // Don't confuse failures with AT_FDCWD
+ return (int)AT_FDCWD == -1 ? -2 : -1;
}
bftw_cache_pin(&state->cache, parent);