Skip to content

fix(libc): share delete access on a stream reopened with freopen on Windows - #5034

Closed
MarcZX10 wants to merge 3 commits into
boykopovar:mainfrom
MarcZX10:codex/carry-freopen-delete-share
Closed

MarcZX10 wants to merge 3 commits into
boykopovar:mainfrom
MarcZX10:codex/carry-freopen-delete-share

Conversation

@MarcZX10

Copy link
Copy Markdown
Contributor

What

Carry the three commits from issue #5031, preserving David Samir's original commit authorship. On Windows, after freopen succeeds, open the same file with delete sharing and move that handle onto the stream's descriptor. If the shared handle cannot be opened, close the stream and return the error. Add a regression test that reopens a file, renames and removes it while the stream is open, then checks the file contents; update the libc debt entry.

Tested

  • Linux, GCC 12.2 Release: built file_streams_tests; CTest file_streams passed (1/1).
  • MinGW-w64: FileAndHeap.cpp passed -Wall -Wextra -fsyntax-only.
  • Windows runtime was not run in this environment.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw or are listed under technical debt (not applicable; no new stub)
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source (not applicable)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@milescoviello

Copy link
Copy Markdown
Contributor

For the reviewers: #5033 carries the same three commits from #5031, opened a few seconds before this one, also with David's authorship kept. Both PRs have the same code, so the maintainers can choose either one.

AI-assisted: yes

@MarcZX10

Copy link
Copy Markdown
Contributor Author

Closing this duplicate: PR #5033 was opened earlier and carries the identical three-commit patch, preserving David Samir's authorship. #5033 remains the single PR for this issue. My local Linux file_streams test and MinGW syntax check also passed.

@MarcZX10 MarcZX10 closed this Oct 13, 2026
@MarcZX10
MarcZX10 deleted the codex/carry-freopen-delete-share branch October 13, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants