diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-13 10:59:07 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-19 10:48:52 -0200 |
commit | 207c5cd20c15244b7747cacf45b8dc1fd27deaa4 (patch) | |
tree | 59bd5acaf226aba190d775bf560f84e6f497c81e /vl.c | |
parent | 7f3850c2629d197fa339ff877824d91bf77f3a49 (diff) |
runstate: Print state transition when invalid
Makes it easier to debug.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -393,9 +393,12 @@ void runstate_init(void) /* This function will abort() on invalid state transitions */ void runstate_set(RunState new_state) { - if (new_state >= RUN_STATE_MAX || - !runstate_valid_transitions[current_run_state][new_state]) { - fprintf(stderr, "invalid runstate transition\n"); + assert(new_state < RUN_STATE_MAX); + + if (!runstate_valid_transitions[current_run_state][new_state]) { + fprintf(stderr, "ERROR: invalid runstate transition: '%s' -> '%s'\n", + RunState_lookup[current_run_state], + RunState_lookup[new_state]); abort(); } |