diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-23 18:04:52 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-23 18:04:52 +0200 |
commit | dd2c48ddfc7f8bc62c565b43bbd42a3a2a87836d (patch) | |
tree | c160c3d7af3a7709fb33224e8344caafe581fcc4 /src/ctl.c | |
parent | 6e73a7b0822d1fd506c75a662070f447bba94afb (diff) | |
download | pies-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')
-rw-r--r-- | src/ctl.c | 32 |
1 files changed, 23 insertions, 9 deletions
@@ -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: |