diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-05-24 13:51:39 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-05-24 14:08:17 +0300 |
commit | 2ba31eb953d18bb818a87caddcbca80bc8a1d37d (patch) | |
tree | 402aa4fbf3c65c2dea874f48ade2f74f5f863558 /src/progman.c | |
parent | 6dd0ec08db301984b8f8f9082f28006d5915c183 (diff) | |
download | pies-2ba31eb953d18bb818a87caddcbca80bc8a1d37d.tar.gz pies-2ba31eb953d18bb818a87caddcbca80bc8a1d37d.tar.bz2 |
Don't remove finished startup components. Just mark them with status_finished.
* src/ctl.c (pies_comp_mode_str): Add pies_comp_startup
and pies_comp_shutdown.
* src/piesctl.c (mode_trans): Likewise.
* src/progman.c (progman_startup_phase): Test the status of
pies_comp_startup components.
(progman_waiting_p): Test status instead of pid>0 to select running
components.
(progman_cleanup): Set status of the finished startup
component to status_finished, instead of removing it.
* src/comp.c (loaded): Remove unused variable.
(component_config_commit): Remove special handling for pies_comp_startup.
Diffstat (limited to 'src/progman.c')
-rw-r--r-- | src/progman.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/progman.c b/src/progman.c index 5bc4eb3..a625885 100644 --- a/src/progman.c +++ b/src/progman.c @@ -326,3 +326,4 @@ progman_startup_phase (void) { - if (IS_COMPONENT (prog) && prog->v.p.comp->mode == pies_comp_startup) + if (IS_COMPONENT (prog) && prog->v.p.comp->mode == pies_comp_startup + && prog->v.p.status == status_running) return 1; @@ -340,3 +341,3 @@ progman_waiting_p (void) if (IS_COMPONENT (prog) - && prog->pid > 0 + && prog->v.p.status == status_running && (prog->wait || prog->v.p.comp->mode == pies_comp_startup)) @@ -2358,10 +2359,2 @@ progman_cleanup (int expect_term) } - else if (prog->v.p.comp->mode == pies_comp_startup) - { - debug (1, (_("removing startup component %s, pid=%lu"), - prog_tag (prog), (unsigned long)pid)); - destroy_prog (&prog); - if (!progman_startup_phase ()) - pies_schedule_children (PIES_CHLD_WAKEUP); - } else @@ -2381,2 +2374,8 @@ progman_cleanup (int expect_term) } + else if (prog->v.p.comp->mode == pies_comp_startup) + { + prog->v.p.status = status_finished; + if (!progman_startup_phase ()) + pies_schedule_children (PIES_CHLD_WAKEUP); + } else |