fix(libc): fail fopen and freopen of a directory for writing with EISDIR on Windows #8192
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8192"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T02:02:58Z.
What
New
OpenFailurehelper inFileAndHeap.cpp: when a write-mode open fails with EACCES and the path is a directory, the error is EISDIR (21), asvn_open_vnodeanswers.fopenandfreopenuse it. A read-mode open of a directory is not changed: FreeBSD succeeds there, the Windows CRT refuses with EACCES (not part of this PR).Fixes #8191
Tested
Windows 10 (19045), MinGW-w64 GCC 15.2.0, Release, on upstream/main
6bd669e40c+ this commit:guest_filesystem: fails without the change toFileAndHeap.cpp(new cases for "w", "wb", "r+", "a" on a directory), passes with it;guest_append_streamspasses.python tools/check_conventions.py --base upstream/main: passes.freopenpath (same helper, no case of its own).Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code