diff mbox series

[8/9] hawkbit: rename section in swupdate.cfg

Message ID 20180906114041.21828-8-sbabic@denx.de
State Accepted
Headers show
Series [1/9] Use provided macro for exit() | expand

Commit Message

Stefano Babic Sept. 6, 2018, 11:40 a.m. UTC
As preparation to support more server in suricatta mode,
rename the section for hawkbit from "suricatta" to
"hawkbit", but still search in "suricatta" to maintain
compatibility.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 suricatta/server_hawkbit.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c
index 31266c0..106b535 100644
--- a/suricatta/server_hawkbit.c
+++ b/suricatta/server_hawkbit.c
@@ -1501,7 +1501,7 @@  void suricatta_print_help(void)
 	    DEFAULT_RESUME_DELAY);
 }
 
-static int suricatta_settings(void *elem, void  __attribute__ ((__unused__)) *data)
+static int server_hawkbit_settings(void *elem, void  __attribute__ ((__unused__)) *data)
 {
 	char tmp[128];
 
@@ -1566,7 +1566,16 @@  server_op_res_t server_start(char *fname, int argc, char *argv[])
 	LIST_INIT(&server_hawkbit.configdata);
 
 	if (fname) {
-		read_module_settings(fname, "suricatta", suricatta_settings,
+		/*
+		 * Search "suricatta" section to be compatible with past
+		 */
+		read_module_settings(fname, "suricatta", server_hawkbit_settings,
+					NULL);
+		/*
+		 * Then try "hawkbit" because each server has its own
+		 * section
+		 */
+		read_module_settings(fname, "hawkbit", server_hawkbit_settings,
 					NULL);
 		read_module_settings(fname, "identify", settings_into_dict,
 					&server_hawkbit.configdata);