From 6ffb36d49f746c24da3e3fcf5c433f3279a451bb Mon Sep 17 00:00:00 2001 From: elwrcl Date: Fri, 2 Oct 2026 17:52:19 +0300 Subject: [PATCH] test: let the detach test's child exit --- src/detach.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/detach.rs b/src/detach.rs index 1eeba77..e906aa8 100644 --- a/src/detach.rs +++ b/src/detach.rs @@ -65,7 +65,8 @@ mod tests { rustix::io::read(&report_r, &mut is_null).unwrap(); assert_eq!(is_null, [1], "child stdout should be /dev/null"); - // Closing our end lets the child exit. - drop(go_w); + // Let the child exit. Closing our end isn't enough: the child holds + // its own copy of `go_w` from the fork. + rustix::io::write(&go_w, &[1]).unwrap(); } }