Skip to content

Commit

Permalink
Rollup merge of #127460 - Borgerr:clarify-drop-comment, r=jhpratt
Browse files Browse the repository at this point in the history
clarify `sys::unix::fd::FileDesc::drop` comment

closes #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 3e8e8df + a0f2b41 commit 55d25ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/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 55d25ce

Please sign in to comment.