about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAshton Hunt <ashkernel02@gmail.com>2024-07-07 09:29:16 -0600
committerAshton Hunt <ashkernel02@gmail.com>2024-07-07 09:29:16 -0600
commita0f2b41d03bd5118df86f29d5a75756990bc4cd9 (patch)
tree15b78fcc6a460c83a5641ee5db5f20d465063f09
parent382148d9a21ae0b506adf44fc1e55a410acde828 (diff)
downloadrust-a0f2b41d03bd5118df86f29d5a75756990bc4cd9.tar.gz
rust-a0f2b41d03bd5118df86f29d5a75756990bc4cd9.zip
clarify `sys::unix::fd::FileDesc::drop` comment (#66876)
-rw-r--r--library/std/src/os/fd/owned.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs
index 8c7fc4cb2e4..a1f83029d27 100644
--- a/library/std/src/os/fd/owned.rs
+++ b/library/std/src/os/fd/owned.rs
@@ -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)]