Skip to content

Commit 60c09aa

Browse files
authored
Unrolled build for rust-lang#127460
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 cfd7cf5 + a0f2b41 commit 60c09aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/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)