diff options
Diffstat (limited to 'src/comp.c')
-rw-r--r-- | src/comp.c | 23 |
1 files changed, 1 insertions, 22 deletions
@@ -21,17 +21,12 @@ | |||
21 | struct complist | 21 | struct complist |
22 | { | 22 | { |
23 | struct component *head; | 23 | struct component *head; |
24 | struct component *tail; | 24 | struct component *tail; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | /* 0 on the first load, and 1 on all subsequent reloads. Tells the | ||
28 | component_config_commit whether we're starting from scratch or just | ||
29 | updating an already loaded configuration */ | ||
30 | static int loaded; | ||
31 | |||
32 | static struct complist comp_list[2]; | 27 | static struct complist comp_list[2]; |
33 | static int cur; | 28 | static int cur; |
34 | 29 | ||
35 | static struct component **comp_array; | 30 | static struct component **comp_array; |
36 | static size_t comp_count; | 31 | static size_t comp_count; |
37 | 32 | ||
@@ -537,22 +532,13 @@ component_config_commit (void) | |||
537 | } | 532 | } |
538 | else | 533 | else |
539 | comp_array = grecs_realloc (comp_array, i * sizeof (comp_array[0])); | 534 | comp_array = grecs_realloc (comp_array, i * sizeof (comp_array[0])); |
540 | comp_count = i; | 535 | comp_count = i; |
541 | 536 | ||
542 | /* Rearrange components, registering entries for the new ones */ | 537 | /* Rearrange components, registering entries for the new ones */ |
543 | for (comp = list->head, i = 0; comp; ) | 538 | for (comp = list->head, i = 0; comp; comp = comp->next, i++) |
544 | { | ||
545 | struct component *next = comp->next; | ||
546 | if (loaded && comp->mode == pies_comp_startup) | ||
547 | { | ||
548 | /* Ignore startup components */ | ||
549 | component_unlink (comp); | ||
550 | component_free (comp); | ||
551 | } | ||
552 | else | ||
553 | { | 539 | { |
554 | match = complist_find_match (prev, comp); | 540 | match = complist_find_match (prev, comp); |
555 | if (match) | 541 | if (match) |
556 | { | 542 | { |
557 | component_merge (match, comp); | 543 | component_merge (match, comp); |
558 | component_unlink (match); | 544 | component_unlink (match); |
@@ -560,18 +546,13 @@ component_config_commit (void) | |||
560 | component_link (match, comp->prev); | 546 | component_link (match, comp->prev); |
561 | component_free (comp); | 547 | component_free (comp); |
562 | comp = match; | 548 | comp = match; |
563 | } | 549 | } |
564 | comp_array[i] = comp; | 550 | comp_array[i] = comp; |
565 | comp->arridx = i; | 551 | comp->arridx = i; |
566 | i++; | ||
567 | } | 552 | } |
568 | comp = next; | ||
569 | } | ||
570 | /* Adjust comp_count */ | ||
571 | comp_count = i; | ||
572 | 553 | ||
573 | /* Mark orphaned progs for termination */ | 554 | /* Mark orphaned progs for termination */ |
574 | list = &comp_list[prev]; | 555 | list = &comp_list[prev]; |
575 | if (list->head) | 556 | if (list->head) |
576 | { | 557 | { |
577 | progman_foreach (mark_prog, NULL); | 558 | progman_foreach (mark_prog, NULL); |
@@ -582,14 +563,12 @@ component_config_commit (void) | |||
582 | component_build_depmap (); | 563 | component_build_depmap (); |
583 | 564 | ||
584 | /* Register new progs */ | 565 | /* Register new progs */ |
585 | for (comp = comp_list[cur].head; comp; comp = comp->next) | 566 | for (comp = comp_list[cur].head; comp; comp = comp->next) |
586 | if (!comp->prog) | 567 | if (!comp->prog) |
587 | register_prog (comp); | 568 | register_prog (comp); |
588 | |||
589 | loaded = 1; | ||
590 | } | 569 | } |
591 | 570 | ||
592 | static int | 571 | static int |
593 | component_verify (struct component *comp, grecs_locus_t *locus) | 572 | component_verify (struct component *comp, grecs_locus_t *locus) |
594 | { | 573 | { |
595 | int header = 0; | 574 | int header = 0; |