Update conf parer (introduce new fields)
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 5 Aug 2013 10:55:46 +0000 (19:55 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 5 Aug 2013 10:55:46 +0000 (19:55 +0900)
[model] Redwood
[binary_type] AP
[customer] Docomo/Orange/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: I9014ed790adaebc83cbea3da5a3a153b4f9741b8

include/conf.h
src/conf.c

index 806b7b9..c8a3cc4 100644 (file)
@@ -50,6 +50,7 @@ struct conf {
        double slave_ttl;
        double slave_activate_time;
        double slave_relaunch_time;
+       int slave_relaunch_count;
 
        int max_log_line;
        int max_log_file;
@@ -134,6 +135,7 @@ extern int conf_loader(void);
 #define SLAVE_TTL              g_conf.slave_ttl
 #define SLAVE_ACTIVATE_TIME    g_conf.slave_activate_time
 #define SLAVE_RELAUNCH_TIME    g_conf.slave_relaunch_time
+#define SLAVE_RELAUNCH_COUNT   g_conf.slave_relaunch_count
 
 #define MAX_LOG_LINE           g_conf.max_log_line
 #define MAX_LOG_FILE           g_conf.max_log_file
index 750cce1..3463e4d 100644 (file)
@@ -233,6 +233,12 @@ static void slave_relaunch_time_handler(char *buffer)
        DbgPrint("Slave relaunch time: %lf\n", g_conf.slave_relaunch_time);
 }
 
+static void slave_relaunch_count_handler(char *buffer)
+{
+       if (sscanf(buffer, "%d", &g_conf.slave_relaunch_count) != 1)
+               ErrPrint("Failed to parse the relaunch count\n");
+}
+
 static void max_log_line_handler(char *buffer)
 {
        if (sscanf(buffer, "%d", &g_conf.max_log_line) != 1)
@@ -398,6 +404,10 @@ HAPI int conf_loader(void)
                        .handler = slave_relaunch_time_handler,
                },
                {
+                       .name = "slave_relaunch_count",
+                       .handler = slave_relaunch_count_handler,
+               },
+               {
                        .name = "max_log_line",
                        .handler = max_log_line_handler,
                },