summaryrefslogtreecommitdiffabout
path: root/src/comp.c
authorSergey Poznyakoff <gray@gnu.org.ua>2016-02-26 20:16:15 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-02-26 20:18:22 (GMT)
commit72b788de87b57b75eb2dd18040523857de1fb58c (patch) (side-by-side diff)
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') (more/less context) (ignore whitespace changes)
-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)
return IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp);
}
-/* If PROG is a leftover, mark it for termination */
+/* If PROG is a leftover, mark it for termination. If it is a listener,
+ terminate it immediately. This ensures that all decomissioned sockets
+ are closed before the subsequent call to progman_create_sockets, which
+ might need to reopen some of them.
+*/
static int
mark_prog (struct prog *prog, void *data)
{
if (prog_is_leftover (prog))
- prog->stop = 1;
+ {
+ prog->stop = 1;
+ if (prog->v.p.status == status_listener)
+ progman_stop_component (&prog);
+ }
return 0;
}
@@ -505,7 +513,7 @@ component_config_commit (void)
if (list->head)
{
progman_foreach (mark_prog, NULL);
- progman_gc ();
+ pies_schedule_children (PIES_CHLD_GC);
}
/* Build dependency map */

Return to:

Send suggestions and report system problems to the System administrator.