From c125f8071b42142fc4f072b7222ace75bdadd726 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 28 Aug 2024 11:09:15 -0400 Subject: bftw: Handle a hypothetical platform where AT_FDCWD == -1 --- src/bftw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3