author | Olivier Brunel
<jjk@jjacky.com> 2018-02-22 18:26:27 UTC |
committer | Olivier Brunel
<jjk@jjacky.com> 2018-02-22 18:26:27 UTC |
parent | 705ac0ef3c665c65be5081eb947cc528a612f3a5 |
src/anopa/start-stop.c | +21 | -17 |
diff --git a/src/anopa/start-stop.c b/src/anopa/start-stop.c index b50b5d3..79f0fb2 100644 --- a/src/anopa/start-stop.c +++ b/src/anopa/start-stop.c @@ -971,25 +971,29 @@ exec_cb (int si, aa_evt evt, pid_t pid) { /* ugly hack thing; see aa_exec_service() */ case 0: - clear_draw (); - if ((pid & AA_MODE_START) && !(pid & AA_MODE_IS_DRY) - /* see aa_ensure_service_loaded() for more */ - && s->st.type == AA_TYPE_LONGRUN - && s->gets_ready - && s->st.code == ERR_ALREADY_UP) - { - aa_bs (AA_OUT, aa_service_name (s)); - aa_bs_flush (AA_OUT, ": Getting ready...\n"); - } - else { - if (!(pid & AA_MODE_IS_DRY)) - aa_bs (AA_OUT, - (pid & AA_MODE_START) ? "Starting " : "Stopping "); - aa_bs (AA_OUT, aa_service_name (aa_service (si))); - aa_bs_flush (AA_OUT, (pid & AA_MODE_IS_DRY) ? "\n" : "...\n"); + aa_mode mode = (aa_mode) pid; + + clear_draw (); + if ((mode & AA_MODE_START) && !(mode & AA_MODE_IS_DRY) + /* see aa_ensure_service_loaded() for more */ + && s->st.type == AA_TYPE_LONGRUN + && s->gets_ready + && s->st.code == ERR_ALREADY_UP) + { + aa_bs (AA_OUT, aa_service_name (s)); + aa_bs_flush (AA_OUT, ": Getting ready...\n"); + } + else + { + if (!(mode & AA_MODE_IS_DRY)) + aa_bs (AA_OUT, + (mode & AA_MODE_START) ? "Starting " : "Stopping "); + aa_bs (AA_OUT, aa_service_name (aa_service (si))); + aa_bs_flush (AA_OUT, (mode & AA_MODE_IS_DRY) ? "\n" : "...\n"); + } + break; } - break; case AA_EVT_STARTING: case AA_EVT_STOPPING: