Rollup merge of #127460 - Borgerr:clarify-drop-comment, r=jhpratt

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.
This commit is contained in:
Matthias Krüger 2024-07-08 16:28:17 +02:00 committed by GitHub
commit 55d25ceccb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)]