Skip to content

Commit ecc9025

Browse files
committed
clarify sys::unix::fd::FileDesc::drop comment (rust-lang#66876)
1 parent a86fd0f commit ecc9025

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)