firmware: stop profiler before rebooting too.

This commit is contained in:
whitequark 2018-05-05 01:52:44 +00:00
parent 9dc7efefe4
commit 68ef09ed73
1 changed files with 6 additions and 2 deletions

View File

@ -129,17 +129,21 @@ fn worker(io: &Io, stream: &mut TcpStream) -> io::Result<()> {
} }
Request::Hotswap(firmware) => { Request::Hotswap(firmware) => {
profiler::stop();
warn!("hotswapping firmware");
Reply::RebootImminent.write_to(stream)?; Reply::RebootImminent.write_to(stream)?;
stream.close()?; stream.close()?;
stream.flush()?; stream.flush()?;
profiler::stop();
warn!("hotswapping firmware");
unsafe { boot::hotswap(&firmware) } unsafe { boot::hotswap(&firmware) }
} }
Request::Reboot => { Request::Reboot => {
Reply::RebootImminent.write_to(stream)?; Reply::RebootImminent.write_to(stream)?;
stream.close()?; stream.close()?;
stream.flush()?;
profiler::stop();
warn!("restarting"); warn!("restarting");
unsafe { boot::reset() } unsafe { boot::reset() }
} }