Commit e4178c3b authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: allow to re-run run_once sections when error

Retry next time when there is an error in "run_once" sections.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 087d44f6
......@@ -123,6 +123,8 @@ static void get_boot_info(void){
"CPU's Reset Controller Status Register\n");
/* pass error to SNMP, assign 1 */
wrsBootStatus_s.wrsRestartReason = WRS_RESTART_REASON_ERROR;
/* try again next time */
run_once = 0;
} else {
/* reset reason values are from 0 to 4, SNMP enum is from
* 2 to 6, so "+ 2", 1 is reserved for error */
......@@ -136,6 +138,8 @@ static void get_boot_info(void){
BOOTCOUNT_FILE"\n");
/* notify snmp about error in restart reason */
wrsBootStatus_s.wrsRestartReason = WRS_RESTART_REASON_ERROR;
/* try again next time */
run_once = 0;
return;
}
......@@ -288,6 +292,8 @@ static void get_boot_scripts_status(void){
* a problem */
wrsBootStatus_s.wrsBootHwinfoReadout =
WRS_BOOT_HWINFO_ERROR_MINOR;
/* try again next time */
run_once = 0;
}
/* result of loading FPGA */
......@@ -310,6 +316,8 @@ static void get_boot_scripts_status(void){
* a problem */
wrsBootStatus_s.wrsBootLoadFPGA =
WRS_BOOT_LOAD_FPGA_ERROR_MINOR;
/* try again next time */
run_once = 0;
}
/* result of loading LM32 */
......@@ -332,6 +340,8 @@ static void get_boot_scripts_status(void){
* a problem */
wrsBootStatus_s.wrsBootLoadLM32 =
WRS_BOOT_LOAD_LM32_ERROR_MINOR;
/* try again next time */
run_once = 0;
}
}
......
......@@ -96,6 +96,8 @@ time_t wrsVersion_data_fill(void)
if (!f) {
snmp_log(LOG_ERR, "SNMP: wrsVersion filed to execute "
VERSION_COMMAND"\n");
/* try again next time */
run_once = 0;
return time_cur;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment