Skip to content

Commit

Permalink
fsm: handle DEVICE_DOWN event
Browse files Browse the repository at this point in the history
  • Loading branch information
wipawel committed Jul 10, 2014
1 parent ce196d0 commit 68ffd4e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,12 @@ ni_ifworker_advance_state(ni_ifworker_t *w, ni_event_t event_type)
unsigned int min_state = NI_FSM_STATE_NONE, max_state = __NI_FSM_STATE_MAX;

switch (event_type) {
case NI_EVENT_DEVICE_DOWN:
min_state = ni_ifworker_can_delete(w) ?
NI_FSM_STATE_DEVICE_DOWN : NI_FSM_STATE_DEVICE_READY;
if (ni_ifworker_complete(w))
ni_ifworker_rearm(w);
break;
case NI_EVENT_DEVICE_CREATE:
min_state = NI_FSM_STATE_DEVICE_EXISTS;
break;
Expand Down

0 comments on commit 68ffd4e

Please sign in to comment.