Skip to content

Preserve the Windows GetLastError error in HandleOrInvalid. #95158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 22, 2022

Conversation

sunfishcode
Copy link
Member

In the TryFrom<HandleOrInvalid> for OwnedHandle and
TryFrom<HandleOrNull> for OwnedHandle implemenations, forget the
owned handle on the error path, to avoid calling CloseHandle on an
invalid handle. It's harmless, except that it may overwrite the
thread's GetLastError error.

r? @joshtriplett

In the `TryFrom<HandleOrInvalid> for OwnedHandle` and
`TryFrom<HandleOrNull> for OwnedHandle` implemenations, `forget` the
owned handle on the error path, to avoid calling `CloseHandle` on an
invalid handle. It's harmless, except that it may overwrite the
thread's `GetLastError` error.
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 21, 2022

📌 Commit 6c407d0 has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2022
@bors
Copy link
Collaborator

bors commented Mar 22, 2022

⌛ Testing commit 6c407d0 with merge b9c4067...

@bors
Copy link
Collaborator

bors commented Mar 22, 2022

☀️ Test successful - checks-actions
Approved by: joshtriplett
Pushing b9c4067 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 22, 2022
@bors bors merged commit b9c4067 into rust-lang:master Mar 22, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 22, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b9c4067): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@sunfishcode sunfishcode deleted the sunfishcode/windows-8 branch March 22, 2022 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants