summaryrefslogtreecommitdiffabout
path: root/src/ctl.c
authorSergey Poznyakoff <gray@gnu.org>2016-01-09 16:56:02 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2016-01-09 16:56:02 (GMT)
commit8b112059a0a1295541b275957377aa41b445e42d (patch) (side-by-side diff)
treec2741e113288fa0e56e5fc5f9cd5338a737ffc13 /src/ctl.c
parent3bac84965a1e1515ef1b1448ac559153a4e8ad25 (diff)
downloadpies-8b112059a0a1295541b275957377aa41b445e42d.tar.gz
pies-8b112059a0a1295541b275957377aa41b445e42d.tar.bz2
Minor improvements
* src/ctl.c (ctl_open): Return immediately if control.url is null. (fun_start): Start sleeping component. * src/meta1lex.h: Removed. * src/pies.c (config_parse): Move creation of the default control.url to main.
Diffstat (limited to 'src/ctl.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ctl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 22aecb8..11ec7b4 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -1251,6 +1251,9 @@ int
ctl_open (void)
{
int fd;
+
+ if (!control.url)
+ return 0;
fd = create_socket (control.url, SOCK_STREAM, NULL, 077);
if (fd == -1)
@@ -1877,6 +1880,13 @@ fun_start (struct json_value *result, struct prog *prog)
prog->v.p.status = status_enabled;
json_object_set_string (result, "status", "OK");
}
+ else if (prog->v.p.status == status_sleeping)
+ {
+ prog->v.p.status = status_enabled;
+ prog->v.p.failcount = 0;
+ prog->v.p.timestamp = 0;
+ json_object_set_string (result, "status", "OK");
+ }
else
{
json_object_set_string (result, "status", "ER");

Return to:

Send suggestions and report system problems to the System administrator.