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 /src/comp.c | |
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.
Diffstat (limited to 'src/comp.c')
-rw-r--r-- | src/comp.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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 | */ | ||
368 | static int | 372 | static int |
369 | mark_prog (struct prog *prog, void *data) | 373 | mark_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 */ |