From f1e19d6c967e46cb1fe1820533eae16f8ac875fe Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 6 Feb 2020 11:21:21 +0000 Subject: [PATCH] vhost_user_backend: Forward the error from main thread The main thread returns a Result with any errors from it. Although the error from the join itself was being returned the real error from the thread was being ignored so ensure that it is forwarded. Signed-off-by: Rob Bradford --- vhost_user_backend/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vhost_user_backend/src/lib.rs b/vhost_user_backend/src/lib.rs index 8a266ddaf..fb8c7dc7e 100644 --- a/vhost_user_backend/src/lib.rs +++ b/vhost_user_backend/src/lib.rs @@ -153,9 +153,10 @@ impl VhostUserDaemon { /// terminate. pub fn wait(&mut self) -> Result<()> { if let Some(handle) = self.main_thread.take() { - let _ = handle.join().map_err(Error::WaitDaemon)?; + handle.join().map_err(Error::WaitDaemon)? + } else { + Ok(()) } - Ok(()) } /// Retrieve the vring worker. This is necessary to perform further