Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3fefa04

Browse files
authoredJul 8, 2024
Rollup merge of rust-lang#127460 - Borgerr:clarify-drop-comment, r=jhpratt
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.
2 parents 895175a + ecc9025 commit 3fefa04

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎std/src/os/fd/owned.rs

+5
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ impl Drop for OwnedFd {
175175
// the file descriptor was closed or not, and if we retried (for
176176
// something like EINTR), we might close another valid file descriptor
177177
// opened after we closed ours.
178+
// However, this is usually justified, as some of the major Unices
179+
// do make sure to always close the FD, even when `close()` is interrupted,
180+
// and the scenario is rare to begin with.
181+
// Helpful link to an epic discussion by POSIX workgroup:
182+
// http://austingroupbugs.net/view.php?id=529
178183
#[cfg(not(target_os = "hermit"))]
179184
{
180185
#[cfg(unix)]

0 commit comments

Comments
 (0)
Failed to load comments.