From: Ian Jackson Date: Wed, 5 May 2021 15:08:13 +0000 (+0100) Subject: apitest: Fix off-by-one error in fd closing X-Git-Tag: otter-0.6.0~374 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e79b3516f7f3c78ccf42ecbb1531a7f26ee00037;p=otter.git apitest: Fix off-by-one error in fd closing This caused very-occasional test lockups... Signed-off-by: Ian Jackson --- diff --git a/apitest/apitest.rs b/apitest/apitest.rs index e16d879a..c5fd1da9 100644 --- a/apitest/apitest.rs +++ b/apitest/apitest.rs @@ -388,7 +388,7 @@ pub mod cleanup_notify { for fd in 2.. { if fd == notify_writing_end { continue } let r = close(fd); - if fd >= writing_end && matches!(r, Err(Sys(EBADF))) { + if fd > writing_end && matches!(r, Err(Sys(EBADF))) { break; } }