Skip to content

Commit

Permalink
init: Fix init spinning once init.rc is complete
Browse files Browse the repository at this point in the history
When the init process ran out of actions to execute, cur_action was
NULL and action_queue_empty() was true, but cur_command was still
set.  This patch clears cur_command when a new action is retreived,
and only depends on cur_action and action_queue_empty() to determine
the poll timeout.

Change-Id: Iaa95063c8c267a5b1ada9f20363b99c433e61ac4
  • Loading branch information
colincross committed Apr 22, 2010
1 parent ec35336 commit ebd4613
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ void execute_one_command(void)

if (!cur_action || !cur_command || is_last_command(cur_action, cur_command)) {
cur_action = action_remove_queue_head();
cur_command = NULL;
if (!cur_action)
return;
INFO("processing action %p (%s)\n", cur_action, cur_action->name);
Expand Down Expand Up @@ -762,7 +763,7 @@ int main(int argc, char **argv)
timeout = 0;
}

if (!action_queue_empty() || cur_command)
if (!action_queue_empty() || cur_action)
timeout = 0;

#if BOOTCHART
Expand Down

0 comments on commit ebd4613

Please sign in to comment.