diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-08-28 11:09:15 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-08-28 15:35:47 -0400 |
commit | c125f8071b42142fc4f072b7222ace75bdadd726 (patch) | |
tree | b32111bb93316b235c312f997fa6bee0adb48b6b /src | |
parent | f958851578855e640c63a6d9b3ac637cb65320f8 (diff) | |
download | bfs-c125f8071b42142fc4f072b7222ace75bdadd726.tar.xz |
bftw: Handle a hypothetical platform where AT_FDCWD == -1
Diffstat (limited to 'src')
-rw-r--r-- | src/bftw.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |