File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,6 @@ where
260260{
261261 thread:: spawn ( move || {
262262 let ns = Namespace :: unshare ( ) ?;
263- let _ = ns_tx. send ( ns) ;
264263
265264 let res = async_global_executor:: block_on ( async move {
266265 let iface = iface:: Iface :: new ( ) ?;
@@ -335,7 +334,10 @@ where
335334 bin. stdin ( Stdio :: piped ( ) )
336335 . stdout ( Stdio :: piped ( ) )
337336 . stderr ( Stdio :: piped ( ) ) ;
338- let mut child = bin. spawn ( ) ?;
337+ let mut child = bin. spawn ( ) . map_err ( |e| {
338+ log:: error!( "cannot start machine {:?}: {}" , bin, e) ;
339+ e
340+ } ) ?;
339341 let mut stdout = BufReader :: new ( child. stdout . take ( ) . unwrap ( ) ) . lines ( ) . fuse ( ) ;
340342 let mut stderr = BufReader :: new ( child. stderr . take ( ) . unwrap ( ) ) . lines ( ) . fuse ( ) ;
341343 let mut stdin = child. stdin . take ( ) . unwrap ( ) ;
@@ -387,6 +389,9 @@ where
387389 . fuse ( ) ;
388390 futures:: pin_mut!( stderr_task) ;
389391
392+ // unblock here so that possible exec error has a chance to get out
393+ let _ = ns_tx. send ( ns) ;
394+
390395 futures:: select! {
391396 res = ctrl_task => res?,
392397 res = reader_task => res?,
You can’t perform that action at this time.
0 commit comments