aboutsummaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
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
@@ -21,17 +21,12 @@
struct complist
{
struct component *head;
struct component *tail;
};
-/* 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;
static struct component **comp_array;
static size_t comp_count;
@@ -537,41 +532,27 @@ component_config_commit (void)
}
else
comp_array = grecs_realloc (comp_array, i * sizeof (comp_array[0]));
comp_count = i;
/* 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 */
list = &comp_list[prev];
if (list->head)
{
progman_foreach (mark_prog, NULL);
@@ -582,14 +563,12 @@ component_config_commit (void)
component_build_depmap ();
/* Register new progs */
for (comp = comp_list[cur].head; comp; comp = comp->next)
if (!comp->prog)
register_prog (comp);
-
- loaded = 1;
}
static int
component_verify (struct component *comp, grecs_locus_t *locus)
{
int header = 0;

Return to:

Send suggestions and report system problems to the System administrator.