chiark / gitweb /
ipif: Drop things in the right order, to avoid child SIPIPE
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Aug 2021 00:48:22 +0000 (01:48 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Aug 2021 00:48:22 +0000 (01:48 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/ipif.rs

index a466a790d47cfe286e26cb6f318282ae20254850..9b57086edffad2c5e23122cc93d0ce0d4c5b7b05 100644 (file)
@@ -48,7 +48,7 @@ impl Ipif {
 
   pub async fn quitting(mut self, ic: Option<&InstanceConfig>) {
     let icd = OptionPrefixColon(ic);
-    drop(self.tx);
+    drop(self.rx);
 
     match self.child.wait().await {
       Err(e) => error!("{}also, failed to await ipif child: {}", icd, e),
@@ -79,5 +79,7 @@ impl Ipif {
         }
       }
     }
+
+    drop(self.tx);
   }
 }