Skip to content

Commit

Permalink
nanny: ni_nanny_discover_state() checks initial state
Browse files Browse the repository at this point in the history
This function performs initial refresh and sets initial state.
  • Loading branch information
wipawel committed Jun 6, 2014
1 parent b3f3e1a commit 142c280
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions nanny/main.c
Expand Up @@ -227,9 +227,6 @@ babysit(void)

ni_fsm_do(mgr->fsm, &timeout);

/* Register newly created devices if any */
ni_nanny_discover_state(mgr);

if (ni_socket_wait(timeout) != 0)
ni_fatal("ni_socket_wait failed");
}
Expand All @@ -254,23 +251,13 @@ ni_nanny_discover_state(ni_nanny_t *mgr)
fsm = mgr->fsm;
ni_fsm_refresh_state(fsm);

/* Register devices that exist (e.g. have just been created) */
/* Register devices that exist */
for (i = 0; i < fsm->workers.count; ++i) {
w = fsm->workers.data[i];

if (w->device)
ni_nanny_register_device(mgr, w);
}

/* Do not recheck on devices that have failed */
for (i = 0; i < mgr->recheck.count; ++i) {
w = mgr->recheck.data[i];

if (w->failed) {
ni_ifworker_array_remove(&mgr->recheck, w);
ni_ifworker_reset(w);
}
}
}

void
Expand Down

0 comments on commit 142c280

Please sign in to comment.