From e79b3516f7f3c78ccf42ecbb1531a7f26ee00037 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 5 May 2021 16:08:13 +0100 Subject: [PATCH] apitest: Fix off-by-one error in fd closing This caused very-occasional test lockups... Signed-off-by: Ian Jackson --- apitest/apitest.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- 2.30.2