aboutsummaryrefslogtreecommitdiff
path: root/src/prog.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-02-16 07:15:42 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-02-16 07:15:42 +0200
commitbd8bd1640c72ceefd87b46a7a3d378c78c9081f5 (patch)
tree8224d8dfd67ab70240744dfb2df4c3af9fd1f850 /src/prog.h
parent27366c475aa4955f296f169cf9acd33e36b9d7b3 (diff)
downloadpies-bd8bd1640c72ceefd87b46a7a3d378c78c9081f5.tar.gz
pies-bd8bd1640c72ceefd87b46a7a3d378c78c9081f5.tar.bz2
Associate program's activity flag with prog, instead of with component.
The CF_DISABLED flag is still retained to indicate that the component is disabled administratively. * src/prog.h (prog.v.p) <active>: New member. (IS_ACTIVE_COMPONENT): Use active flag. * src/comp.c (component_finish): Don't modify component flags. * src/ctl.c (prog_serialize): Replace attribute "disabled" with "active". (fun_stop): Set prog->v.p.active * src/pies.c (main): Use pies_master_argv to check whether program name is absolute. * src/piesctl.c (print_comp): Check "active" attribute. * src/progman.c (register_prog0): Set prog->v.p.active. (progman_create_sockets): Remove components if their socket cannot be opened. (progman_lookup_tcpmux, prog_open_socket) (prog_start, progman_start) (prog_start_prerequisites, react): Operate on prog->v.p.active to test/change prog's activity state. * src/sysvinit.c (enablecomp, runlevel_setup_prog): Operate on prog->v.p.active to test/change prog's activity state. (demand_prog, IS_RUNNING_DISABLED_PROG): Likewise.
Diffstat (limited to 'src/prog.h')
-rw-r--r--src/prog.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/prog.h b/src/prog.h
index 4658518..3b20979 100644
--- a/src/prog.h
+++ b/src/prog.h
@@ -51,7 +51,8 @@ struct prog
51 struct 51 struct
52 { 52 {
53 struct component *comp; 53 struct component *comp;
54 int wait; 54 int wait :1;
55 int active :1;
55 int socket; 56 int socket;
56 struct prog *redir[2]; /* Pointers to redirectors */ 57 struct prog *redir[2]; /* Pointers to redirectors */
57 time_t timestamp; /* Time of last startup */ 58 time_t timestamp; /* Time of last startup */
@@ -82,7 +83,7 @@ struct prog
82 83
83#define IS_COMPONENT(p) ((p)->type == TYPE_COMPONENT) 84#define IS_COMPONENT(p) ((p)->type == TYPE_COMPONENT)
84#define IS_ACTIVE_COMPONENT(prog) \ 85#define IS_ACTIVE_COMPONENT(prog) \
85 (IS_COMPONENT(prog) && !((prog)->v.p.comp->flags & CF_DISABLED)) 86 (IS_COMPONENT(prog) && (prog)->v.p.active)
86 87
87struct prog *progman_locate (const char *name); 88struct prog *progman_locate (const char *name);
88int progman_foreach (int (*filter) (struct prog *, void *data), void *data); 89int progman_foreach (int (*filter) (struct prog *, void *data), void *data);

Return to:

Send suggestions and report system problems to the System administrator.