From 585f73adde62be8ecd8bc833f3a7e55f83837a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 10 Jul 2021 02:38:27 +1200 Subject: [PATCH] Poll process completion harder on windows --- lib/src/process.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/process.rs b/lib/src/process.rs index 33a0171f..4084b9b4 100644 --- a/lib/src/process.rs +++ b/lib/src/process.rs @@ -423,7 +423,15 @@ mod imp { } pub fn is_complete(&self) -> bool { - self.wait_for_completion(0).unwrap_or(false) + // you need to poll a few times to get the real answer + // if the process has already completed... odd but okay + for _ in 0..5 { + if let Some(true) = self.wait_for_completion(0) { + return true; + } + } + + false } pub fn wait(&self) {