chiark / gitweb /
client: report ipif exit status if it fails
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 5 Aug 2021 00:07:34 +0000 (01:07 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 5 Aug 2021 00:07:34 +0000 (01:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/client.rs

index 42d3dc011e51b1404783c26446c259e48d0b2b3c..75e868d60c14914ef6b4500f4bd37d4faa1af774 100644 (file)
@@ -211,7 +211,7 @@ async fn run_client<C:HCC>(
 
   let mut rx_queue: FrameQueue = default();
 
-  async {
+  let trouble = async {
     loop {
       let rx_queue_space = 
         if rx_queue.remaining() < ic.max_batch_down.sat() {
@@ -310,7 +310,17 @@ async fn run_client<C:HCC>(
         },
       }
     }
-  }.await
+  }.await;
+
+  drop(tx_stream);
+
+  match ipif.wait().await {
+    Err(e) => error!("{}: also, failed to await ipif child: {}", &ic, e),
+    Ok(st) if st.success() => { },
+    Ok(st) => error!("{}: ipif process failed: {}", &ic, st),
+  }
+
+  trouble
 }
 
 #[tokio::main]