runtime: hotswap slightly more carefully.

This generally lets some last characters out of UART, last ACKs
out of queues, etc. Nothing guaranteed though.
This commit is contained in:
whitequark 2017-12-15 06:19:31 +00:00
parent 4a9d8c9459
commit 8cece4f260
1 changed files with 2 additions and 1 deletions

View File

@ -82,9 +82,10 @@ fn worker(io: &Io, stream: &mut TcpStream) -> io::Result<()> {
},
Request::Hotswap(firmware) => {
warn!("hotswapping firmware");
Reply::RebootImminent.write_to(stream)?;
stream.close()?;
warn!("hotswapping firmware");
stream.flush()?;
unsafe { board::boot::hotswap(&firmware) }
},