| 333 | } |
| 334 | |
| 335 | static void wd_resource_failed (struct cs_fsm* fsm, int32_t event, void * data) |
| 336 | { |
| 337 | struct resource* ref = (struct resource*)data; |
| 338 | |
| 339 | if (ref->check_timer) { |
| 340 | api->timer_delete(ref->check_timer); |
| 341 | ref->check_timer = 0; |
| 342 | } |
| 343 | |
| 344 | log_printf (LOGSYS_LEVEL_CRIT, "%s resource \"%s\" failed!", |
| 345 | ref->recovery, (char*)ref->name); |
| 346 | if (strcmp (ref->recovery, "watchdog") == 0 || |
| 347 | strcmp (ref->recovery, "quit") == 0) { |
| 348 | watchdog_ok = 0; |
| 349 | } |
| 350 | else if (strcmp (ref->recovery, "reboot") == 0) { |
| 351 | reboot(RB_AUTOBOOT); |
| 352 | } |
| 353 | else if (strcmp (ref->recovery, "shutdown") == 0) { |
| 354 | reboot(RB_POWER_OFF); |
| 355 | } |
| 356 | cs_fsm_state_set(fsm, WD_S_FAILED, data, wd_fsm_cb); |
| 357 | } |
| 358 | |
| 359 | static void wd_key_changed( |
| 360 | int32_t event, |
nothing calls this directly
no test coverage detected