fix(libc): let perror skip a closed standard error #10782
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10782"
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 MarcZX10 on 2026-10-25T00:31:35Z.
What
perrorafter a failedfreopenof stderr threwFileStream: closed streamout of the export. It now returns without writing and leaves errno unchanged.perrorreturns void, so there is no result to report; the change only stops the exception from escaping. Two commits: fix, test.Open PR #10324 changes the orientation handling of other functions in the same area; the two changes are independent.
Tested
Rebase follow-up (2026-10-25): rebased onto current upstream
maine7e3e9c1984c293f06bff08428b8c89b7b932ac2without conflicts. Pairwise combined merges with #10766 and #10781 are clean; the changes cover separate standard-stream functions/tests. On the rebased head, GCC 12.2 C++20-Wall -Wextra -Werrorsyntax checks passed forErrors.cppandGuestStandardStreams.cpp;git diff --checkandtools/check_conventions.py --base upstream/mainpassed. The full local CMake test build could not configure because the SDL2 CMake package is unavailable, so no post-rebase runtime test is claimed. The runtime evidence below is from the prior base.Linux x86-64 (Debian 12, GCC 12), Ninja Release. The extended
guest_standard_streams_closed_stdoutcase callsperrorwith a prefix and with a null prefix on a closed stderr and checks errno stays 2: it fails on currentmainwith an uncaughtruntime_errorand passes with the fix. The behaviour on a console was not measured.python3 tools/check_conventions.py --base upstream/main --head HEADandgit diff --check upstream/mainpass. Windows, macOS and hardware were not run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T02:11:34Z.
Review: COMMENTED
I reviewed the current head and ran the focused local checks available for this change. The review found no additional blocking issue; the recorded scope and test claims match the diff. CI is green for the jobs that ran; the host product jobs are skipped by the current workflow.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T02:12:51Z.
Review: COMMENTED
I checked the current implementation and test coverage for the closed-stderr case, including null and non-null prefixes and preserving errno. The change is consistent with the void perror contract and keeps the exception from escaping. The relinker, ASan, register-context and write-watch CI jobs passed; product jobs are skipped. No additional blocking issue found.