mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
## Summary - Fix `fs.Dirent.isFIFO()` incorrectly returning `true` for unknown file types (e.g., on sshfs/NFS mounts) - Remove the `EventPort` check from `isFIFO()` since `EventPort = 0 = Unknown` - Add regression test for the fix Fixes #24129 ## Root Cause In `NodeDirent.cpp`, the `isFIFO()` method was checking: ```cpp type == static_cast<int32_t>(DirEntType::NamedPipe) || type == static_cast<int32_t>(DirEntType::EventPort) ``` Since `EventPort = 0` and `Unknown = 0` (they share the same enum value), any file with unknown type (returned by filesystems like sshfs, NFS, etc. that don't populate `d_type`) would incorrectly trigger `isFIFO() === true`. ## Test plan - [x] Regression test: `bun bd test test/regression/issue/24129.test.ts` - [x] Existing Dirent tests: `bun bd test test/js/node/fs/fs.test.ts -t "Dirent"` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB