From 585e90c0decab4a803b6f8edabfd888aa52c23b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 4 Dec 2020 09:49:44 +0100 Subject: [PATCH] tokio: adapt to 1.0 process:Child changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Child itself is no longer a Future, but it has a new wait() async fn that does the same thing Signed-off-by: Fabian Grünbichler --- src/api2/node.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/api2/node.rs b/src/api2/node.rs index b1a25e0e..51dfdd19 100644 --- a/src/api2/node.rs +++ b/src/api2/node.rs @@ -197,7 +197,7 @@ async fn termproxy( let mut needs_kill = false; let res = tokio::select!{ - res = &mut child => { + res = child.wait() => { let exit_code = res?; if !exit_code.success() { match exit_code.code() { @@ -217,14 +217,13 @@ async fn termproxy( if needs_kill { if res.is_ok() { - child.kill()?; - child.await?; + child.kill().await?; return Ok(()); } - if let Err(err) = child.kill() { + if let Err(err) = child.kill().await { worker.warn(format!("error killing termproxy: {}", err)); - } else if let Err(err) = child.await { + } else if let Err(err) = child.wait().await { worker.warn(format!("error awaiting termproxy: {}", err)); } }