summaryrefslogtreecommitdiffabout
path: root/src/ctl.c
authorSergey Poznyakoff <gray@gnu.org.ua>2016-02-23 16:04:52 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-02-23 16:04:52 (GMT)
commitdd2c48ddfc7f8bc62c565b43bbd42a3a2a87836d (patch) (side-by-side diff)
treec160c3d7af3a7709fb33224e8344caafe581fcc4 /src/ctl.c
parent6e73a7b0822d1fd506c75a662070f447bba94afb (diff)
downloadpies-dd2c48ddfc7f8bc62c565b43bbd42a3a2a87836d.tar.gz
pies-dd2c48ddfc7f8bc62c565b43bbd42a3a2a87836d.tar.bz2
Bugfixes
* lib/addrfmt.c: Include limits.h * src/ctl.c (fun_stop,fun_start): Ignore non-component progs. * src/pies.c (request_restart_components): Fix piesctl invocation. * src/pies.h (PIES_CHLD_RESCHEDULE_ALARM): New flag. (progman_wait_until): Remove. (progman_recompute_alarm): New proto. * src/progman.c (recompute_alarm): Remove. All uses raise PIES_CHLD_RESCHEDULE_ALARM instead. (progman_wake_sleeping): Handle status_stopping components independently on their activity flag. (prog_stop_all, progman_wait_until): Remove. (progman_stop): Rewrite using mark+sweep approach.
Diffstat (limited to 'src/ctl.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ctl.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/ctl.c b/src/ctl.c
index fd7bfdc..2d63933 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -1910,22 +1910,36 @@ fun_list (struct json_value *result, struct prog *prog)
static int
fun_stop (struct json_value *result, struct prog *prog)
{
- if (!prog->v.p.active)
- {
- json_object_set_string (result, "status", "ER");
- json_object_set_string (result, "error_message", "already stopped");
- return 1;
+ if (IS_COMPONENT (prog))
+ {
+ if (!prog->v.p.active)
+ {
+ json_object_set_string (result, "status", "ER");
+ json_object_set_string (result, "error_message", "already stopped");
+ return 1;
+ }
+
+ prog->v.p.active = 0;
+ progman_stop_component (&prog);
+ json_object_set_string (result, "status", "OK");
+ }
+ else
+ {
+ //FIXME progman_stop_component (&prog);
+ json_object_set_string (result, "status", "OK");
}
-
- prog->v.p.active = 0;
- progman_stop_component (&prog);
- json_object_set_string (result, "status", "OK");
return 0;
}
static int
fun_start (struct json_value *result, struct prog *prog)
{
+ if (!IS_COMPONENT (prog))
+ {
+ json_object_set_string (result, "status", "ER");
+ json_object_set_string (result, "error_message", "not a component");
+ return 1;
+ }
switch (prog->v.p.status)
{
case status_stopped:

Return to:

Send suggestions and report system problems to the System administrator.