aboutsummaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-02-26 22:16:15 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-02-26 22:18:22 +0200
commit72b788de87b57b75eb2dd18040523857de1fb58c (patch)
tree0a19f715af69c94c2c1764118fb42b48d1cfe27d /src/comp.c
parentd52c1fb800ccd48fe82f08b5340ff2262f92869f (diff)
downloadpies-72b788de87b57b75eb2dd18040523857de1fb58c.tar.gz
pies-72b788de87b57b75eb2dd18040523857de1fb58c.tar.bz2
Improve previous commit.
* comp.c (mark_prog): Instead of calling progman_gc, terminate the prog if it is a deactivated listener.
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/comp.c b/src/comp.c
index c2e38b5..52913ac 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -364,12 +364,20 @@ prog_is_leftover (struct prog *prog)
364 return IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp); 364 return IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp);
365} 365}
366 366
367/* If PROG is a leftover, mark it for termination */ 367/* If PROG is a leftover, mark it for termination. If it is a listener,
368 terminate it immediately. This ensures that all decomissioned sockets
369 are closed before the subsequent call to progman_create_sockets, which
370 might need to reopen some of them.
371*/
368static int 372static int
369mark_prog (struct prog *prog, void *data) 373mark_prog (struct prog *prog, void *data)
370{ 374{
371 if (prog_is_leftover (prog)) 375 if (prog_is_leftover (prog))
372 prog->stop = 1; 376 {
377 prog->stop = 1;
378 if (prog->v.p.status == status_listener)
379 progman_stop_component (&prog);
380 }
373 return 0; 381 return 0;
374} 382}
375 383
@@ -505,7 +513,7 @@ component_config_commit (void)
505 if (list->head) 513 if (list->head)
506 { 514 {
507 progman_foreach (mark_prog, NULL); 515 progman_foreach (mark_prog, NULL);
508 progman_gc (); 516 pies_schedule_children (PIES_CHLD_GC);
509 } 517 }
510 518
511 /* Build dependency map */ 519 /* Build dependency map */

Return to:

Send suggestions and report system problems to the System administrator.