aboutsummaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-05-24 13:51:39 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-05-24 14:08:17 +0300
commit2ba31eb953d18bb818a87caddcbca80bc8a1d37d (patch)
tree402aa4fbf3c65c2dea874f48ade2f74f5f863558 /src/comp.c
parent6dd0ec08db301984b8f8f9082f28006d5915c183 (diff)
downloadpies-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/comp.c')
-rw-r--r--src/comp.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/src/comp.c b/src/comp.c
index 2346306..25f2657 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -25,9 +25,4 @@ struct complist
};
-/* 0 on the first load, and 1 on all subsequent reloads. Tells the
- component_config_commit whether we're starting from scratch or just
- updating an already loaded configuration */
-static int loaded;
-
static struct complist comp_list[2];
static int cur;
@@ -541,33 +536,19 @@ component_config_commit (void)
/* Rearrange components, registering entries for the new ones */
- for (comp = list->head, i = 0; comp; )
+ for (comp = list->head, i = 0; comp; comp = comp->next, i++)
{
- struct component *next = comp->next;
- if (loaded && comp->mode == pies_comp_startup)
+ match = complist_find_match (prev, comp);
+ if (match)
{
- /* Ignore startup components */
- component_unlink (comp);
+ component_merge (match, comp);
+ component_unlink (match);
+ match->listidx = cur;
+ component_link (match, comp->prev);
component_free (comp);
+ comp = match;
}
- else
- {
- match = complist_find_match (prev, comp);
- if (match)
- {
- component_merge (match, comp);
- component_unlink (match);
- match->listidx = cur;
- component_link (match, comp->prev);
- component_free (comp);
- comp = match;
- }
- comp_array[i] = comp;
- comp->arridx = i;
- i++;
- }
- comp = next;
+ comp_array[i] = comp;
+ comp->arridx = i;
}
- /* Adjust comp_count */
- comp_count = i;
/* Mark orphaned progs for termination */
@@ -586,6 +567,4 @@ component_config_commit (void)
if (!comp->prog)
register_prog (comp);
-
- loaded = 1;
}

Return to:

Send suggestions and report system problems to the System administrator.