summaryrefslogtreecommitdiffabout
path: root/src/comp.c
Side-by-side diff
Diffstat (limited to 'src/comp.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/comp.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/comp.c b/src/comp.c
index 5613e28..6a0e4ba 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -352,3 +352,11 @@ component_config_rollback (void)
}
+
+/* Return true if PROG is a leftover from previous configuration */
+static int
+prog_is_leftover (struct prog *prog)
+{
+ return IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp);
+}
+/* If PROG is a leftover, gracefully stop it and mark as disabled */
static int
@@ -356,7 +364,4 @@ cb_terminate_prog (struct prog *prog, void *data)
{
- if (IS_COMPONENT (prog) && !component_is_active (prog->v.p.comp))
- {
- progman_stop_component (prog);
- prog->v.p.comp->flags |= CF_DISABLED;
- }
+ if (prog_is_leftover (prog))
+ progman_stop_component (&prog);
return 0;
@@ -364,2 +369,3 @@ cb_terminate_prog (struct prog *prog, void *data)
+/* If PROG is a leftover, slay it with SIGKILL */
static int
@@ -367,3 +373,3 @@ cb_kill_prog (struct prog *prog, void *data)
{
- if (!(IS_COMPONENT (prog) && component_is_active (prog->v.p.comp)))
+ if (prog_is_leftover (prog))
prog_stop (prog, SIGKILL);
@@ -511,3 +517,3 @@ component_config_commit (void)
}
-
+
/* Build dependency map */

Return to:

Send suggestions and report system problems to the System administrator.