summaryrefslogtreecommitdiffabout
path: root/src/comp.c
authorSergey Poznyakoff <gray@gnu.org>2019-05-24 10:51:39 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-05-24 11:08:17 (GMT)
commit2ba31eb953d18bb818a87caddcbca80bc8a1d37d (patch) (unidiff)
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') (more/less context) (ignore whitespace changes)
-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
@@ -24,11 +24,6 @@ struct complist
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 */
30static int loaded;
31
32static struct complist comp_list[2]; 27static struct complist comp_list[2];
33static int cur; 28static int cur;
34 29
@@ -540,35 +535,21 @@ component_config_commit (void)
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 { 539 {
545 struct component *next = comp->next; 540 match = complist_find_match (prev, comp);
546 if (loaded && comp->mode == pies_comp_startup) 541 if (match)
547 { 542 {
548 /* Ignore startup components */ 543 component_merge (match, comp);
549 component_unlink (comp); 544 component_unlink (match);
545 match->listidx = cur;
546 component_link (match, comp->prev);
550 component_free (comp); 547 component_free (comp);
548 comp = match;
551 } 549 }
552 else 550 comp_array[i] = comp;
553 { 551 comp->arridx = i;
554 match = complist_find_match (prev, comp);
555 if (match)
556 {
557 component_merge (match, comp);
558 component_unlink (match);
559 match->listidx = cur;
560 component_link (match, comp->prev);
561 component_free (comp);
562 comp = match;
563 }
564 comp_array[i] = comp;
565 comp->arridx = i;
566 i++;
567 }
568 comp = next;
569 } 552 }
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];
@@ -585,8 +566,6 @@ component_config_commit (void)
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
592static int 571static int

Return to:

Send suggestions and report system problems to the System administrator.