Skip to content

Commit

Permalink
Rollup merge of rust-lang#127460 - Borgerr:clarify-drop-comment, r=jh…
Browse files Browse the repository at this point in the history
…pratt

clarify `sys::unix::fd::FileDesc::drop` comment

closes rust-lang#66876

simply clarifies some resource-relevant things regarding the `close` syscall to reduce the amount of search needed in other parts of the web.
  • Loading branch information
matthiaskrgr authored Jul 8, 2024
2 parents 895175a + ecc9025 commit 3fefa04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions std/src/os/fd/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ impl Drop for OwnedFd {
// the file descriptor was closed or not, and if we retried (for
// something like EINTR), we might close another valid file descriptor
// opened after we closed ours.
// However, this is usually justified, as some of the major Unices
// do make sure to always close the FD, even when `close()` is interrupted,
// and the scenario is rare to begin with.
// Helpful link to an epic discussion by POSIX workgroup:
// http://austingroupbugs.net/view.php?id=529
#[cfg(not(target_os = "hermit"))]
{
#[cfg(unix)]
Expand Down

0 comments on commit 3fefa04

Please sign in to comment.