diff mbox series

Reset progress value in swupdate_progress_end()

Message ID 20201110113426.45800-1-sbabic@denx.de
State Accepted
Headers show
Series Reset progress value in swupdate_progress_end() | expand

Commit Message

Stefano Babic Nov. 10, 2020, 11:34 a.m. UTC
Reset value for progress interface in swupdate_progress_end(), that is
always called, instead of swupdate_progress_done()

Signed-off-by: Stefano Babic <sbabic@denx.de>
Suggested-by: Christian Storm <christian.storm@siemens.com>
---
 core/progress_thread.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/core/progress_thread.c b/core/progress_thread.c
index 7c424fc..24d9563 100644
--- a/core/progress_thread.c
+++ b/core/progress_thread.c
@@ -183,6 +183,12 @@  void swupdate_progress_end(RECOVERY_STATUS status)
 	pprog->step_running = false;
 	pprog->msg.status = status;
 	send_progress_msg();
+	pprog->msg.nsteps = 0;
+	pprog->msg.cur_step = 0;
+	pprog->msg.cur_percent = 0;
+	pprog->msg.dwl_percent = 0;
+	pprog->msg.dwl_bytes = 0;
+
 	pthread_mutex_unlock(&pprog->lock);
 }
 
@@ -212,10 +218,6 @@  void swupdate_progress_done(const char *info)
 	pprog->msg.status = DONE;
 	send_progress_msg();
 	pprog->msg.infolen = 0;
-	pprog->msg.nsteps = 0;
-	pprog->msg.cur_step = 0;
-	pprog->msg.cur_percent = 0;
-	pprog->msg.dwl_percent = 0;
 	pthread_mutex_unlock(&pprog->lock);
 }