Repository navigation
fix(libc): report POSIX rename errors like the console - #2784
Closed
HyperDarkmoon wants to merge 1 commit into
Closed
HyperDarkmoon wants to merge 1 commit into
HyperDarkmoon wants to merge 1 commit into
Conversation
Matches the FreeBSD error matrix from boykopovar#2403: a missing destination parent, a directory replaced with a file or a directory moved into its own subtree report ENOTDIR, EINVAL and other errors instead of the raw host error. Windows now replaces an existing empty directory instead of failing with EACCES, and inspection failures map to the console's errno rather than EIO.
|
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #2403.
rename(2)now reports the errors the console (FreeBSD) does instead of collapsing host failures intoEIO:ENOENT(2)ENOTDIR(20)EISDIR(21)ENOTEMPTY(66)EINVAL(22)null/empty paths keep the existingEFAULT(14) /ENOENT(2) behaviourOn Windows, replacing an existing empty directory now succeeds (the empty target is removed first) instead of failing with
EACCES, matching the console'srename(dir, empty_dir) == 0.Inspection failures are mapped before being read as "absent":
not_a_directory→ENOTDIR, a genuinenot_found→ENOENT,permission_denied→EACCES, anything else → theEIOfallback.rename_nid_postfixlives incore/libs/prx/libc/src/Rename.cpp, compiled into both libc and libkernel (from #1192), so the fix applies to both. Reopens and replaces the closed #2485.Tested
guest_filesystem_testsandguest_kernel_rename_tests;ctest -R "guest_filesystem|guest_kernel_rename"passes.GuestFilesystem.cppcover the matrix above, including directory replacement on Windows.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)