path: root/src/pies.h
diff options
authorSergey Poznyakoff <gray@gnu.org>2016-02-13 23:55:47 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-02-14 00:05:33 +0200
commit0a5eb4f65a20d37f2051dce8816485dd219fb735 (patch)
treeeadff6490ebf734431c354ac1ba40a4a8537fcb0 /src/pies.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/pies.h')
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pies.h b/src/pies.h
index 14ea7b7..bcce32a 100644
--- a/src/pies.h
+++ b/src/pies.h
@@ -180,8 +180,7 @@ enum pies_comp_mode
180 }; 180 };
181 181
182#define PIES_COMP_DEFAULT 0 182#define PIES_COMP_DEFAULT 0
183#define PIES_COMP_WAIT 0x01 183#define PIES_COMP_MASK(m) (1 << ((m)))
184#define PIES_COMP_MASK(m) (1 << ((m)+1))
185 184
186#define CF_DISABLED 0x001 /* The componenet is disabled */ 185#define CF_DISABLED 0x001 /* The componenet is disabled */
187#define CF_PRECIOUS 0x002 /* The component is precious (should not 186#define CF_PRECIOUS 0x002 /* The component is precious (should not
@@ -317,6 +316,12 @@ void free_redirector (struct redirector *rp);
317void pies_schedule_action (int act); 316void pies_schedule_action (int act);
318void free_action (struct action *act); 317void free_action (struct action *act);
319 318
319#define PIES_CHLD_NONE 0
320#define PIES_CHLD_CLEANUP 0x01
321#define PIES_CHLD_WAKEUP 0x02
323void pies_schedule_children (int op);
320void register_prog (struct component *comp); 325void register_prog (struct component *comp);
321int progman_waiting_p (void); 326int progman_waiting_p (void);
322void progman_start (void); 327void progman_start (void);
@@ -512,7 +517,7 @@ int console_open (int mode);
512int telinit (const char *arg); 517int telinit (const char *arg);
513int inittab_parse (const char *file); 518int inittab_parse (const char *file);
514int sysvinit_sigtrans (int sig, int *pact); 519int sysvinit_sigtrans (int sig, int *pact);
515void sysvinit_runlevel_setup (int mask, int *wait); 520void sysvinit_runlevel_setup (int mask);
516void sysvinit_sysdep_begin (void); 521void sysvinit_sysdep_begin (void);
517void sysvinit_power (void); 522void sysvinit_power (void);
518 523

Return to:

Send suggestions and report system problems to the System administrator.