aboutsummaryrefslogtreecommitdiff
path: root/src/ctl.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-01-09 18:56:02 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-01-09 18:56:02 +0200
commit8b112059a0a1295541b275957377aa41b445e42d (patch)
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')
-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
1251ctl_open (void) 1251ctl_open (void)
1252{ 1252{
1253 int fd; 1253 int fd;
1254
1255 if (!control.url)
1256 return 0;
1254 1257
1255 fd = create_socket (control.url, SOCK_STREAM, NULL, 077); 1258 fd = create_socket (control.url, SOCK_STREAM, NULL, 077);
1256 if (fd == -1) 1259 if (fd == -1)
@@ -1877,6 +1880,13 @@ fun_start (struct json_value *result, struct prog *prog)
1877 prog->v.p.status = status_enabled; 1880 prog->v.p.status = status_enabled;
1878 json_object_set_string (result, "status", "OK"); 1881 json_object_set_string (result, "status", "OK");
1879 } 1882 }
1883 else if (prog->v.p.status == status_sleeping)
1884 {
1885 prog->v.p.status = status_enabled;
1886 prog->v.p.failcount = 0;
1887 prog->v.p.timestamp = 0;
1888 json_object_set_string (result, "status", "OK");
1889 }
1880 else 1890 else
1881 { 1891 {
1882 json_object_set_string (result, "status", "ER"); 1892 json_object_set_string (result, "status", "ER");

Return to:

Send suggestions and report system problems to the System administrator.