diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-26 22:16:15 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-26 22:18:22 +0200 |
commit | 72b788de87b57b75eb2dd18040523857de1fb58c (patch) | |
tree | 0a19f715af69c94c2c1764118fb42b48d1cfe27d | |
parent | d52c1fb800ccd48fe82f08b5340ff2262f92869f (diff) | |
download | pies-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.
-rw-r--r-- | src/comp.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 */ |