path: root/src/prog.h
authorSergey Poznyakoff <>2016-02-13 21:55:47 (GMT)
committer Sergey Poznyakoff <>2016-02-13 22:05:33 (GMT)
commit0a5eb4f65a20d37f2051dce8816485dd219fb735 (patch) (side-by-side diff)
treeeadff6490ebf734431c354ac1ba40a4a8537fcb0 /src/prog.h
parentc9581808b72ff25623c87cf49c471ce7f017985d (diff)
Fix handling of wait components
* src/pies.h (PIES_COMP_WAIT): Remove. (PIES_COMP_MASK): Save one bit. (PIES_CHLD_NONE, PIES_CHLD_CLEANUP) (PIES_CHLD_WAKEUP): New constants. (pies_schedule_children): New proto. (sysvinit_runlevel_setup): Change signature. * src/pies.c (children_cleanup, got_alarm): Merge into single static variable children_op. All uses updated. (pies_schedule_children): New function. (sig_handler): Update (main): Don't call ctl_open for init process. It is done by inittrans after transition from boot to normal state. Update to use pies_schedule_children. * src/prog.h (IS_ACTIVE_COMPONENT): New macro. * src/progman.c (prog_start): Don't modify prog->v.p.wait. (progman_wake_sleeping): Start usual components only after all "wait" components have terminated. (progman_cleanup): If a "wait" component has terminated, request PIES_CHLD_WAKEUP. * src/sysvinit.c (enstate) <wait>: Remove. (enablecomp): Update. (runlevel_setup_prog): Set prog->v.p.wait. (sysvinit_runlevel_setup): Take only one parameter. (inittrans): Remove "wait" and the related mess. Call ctl_open after transition boot -> normal.
Diffstat (limited to 'src/prog.h') (more/less context) (ignore whitespace changes)
1 files changed, 2 insertions, 0 deletions
diff --git a/src/prog.h b/src/prog.h
index 1db2eee..4658518 100644
--- a/src/prog.h
+++ b/src/prog.h
@@ -81,6 +81,8 @@ struct prog
#define IS_COMPONENT(p) ((p)->type == TYPE_COMPONENT)
+#define IS_ACTIVE_COMPONENT(prog) \
+ (IS_COMPONENT(prog) && !((prog)->v.p.comp->flags & CF_DISABLED))
struct prog *progman_locate (const char *name);
int progman_foreach (int (*filter) (struct prog *, void *data), void *data);

Return to:

Send suggestions and report system problems to the System administrator.