diff mbox series

[V2,07/11] Enum for cause field in progress messages

Message ID 20231017140657.95860-8-stefano.babic@swupdate.org
State Accepted
Delegated to: Stefano Babic
Headers show
Series Handle Hawkbit action_id and on the fly updates | expand

Commit Message

Stefano Babic Oct. 17, 2023, 2:06 p.m. UTC
The cause field is unused up now and just zeroed. Add an enum to support
info of specific type and replace occurencies where zero is forced.

The first introduced cause is CAUSE_REBOOT_MODE to infor if the update
requires a reboot or it is a on the fly update.

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 core/parser.c          | 2 +-
 include/progress_ipc.h | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/core/parser.c b/core/parser.c
index 50d9957b..28005597 100644
--- a/core/parser.c
+++ b/core/parser.c
@@ -265,7 +265,7 @@  int parse(struct swupdate_cfg *sw, const char *descfile)
 	if (asprintf(&versioninfo, "{\"VERSION\" : \"%s\"}", sw->version) == ENOMEM_ASPRINTF)
 		ERROR("OOM sending version info");
 	else {
-		swupdate_progress_info(RUN, 0, versioninfo);
+		swupdate_progress_info(RUN, NONE, versioninfo);
 		free(versioninfo);
 	}
 
diff --git a/include/progress_ipc.h b/include/progress_ipc.h
index e00a081f..c1ff78b0 100644
--- a/include/progress_ipc.h
+++ b/include/progress_ipc.h
@@ -16,6 +16,11 @@  extern "C" {
 
 #define PRINFOSIZE	2048
 
+	typedef enum progress_cause {
+	CAUSE_NONE,
+	CAUSE_REBOOT_MODE,
+} progress_cause_t;
+
 extern char* SOCKET_PROGRESS_PATH;
 
 /*