aboutsummaryrefslogtreecommitdiff
path: root/src/pies.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-02-23 18:04:52 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-02-23 18:04:52 +0200
commitdd2c48ddfc7f8bc62c565b43bbd42a3a2a87836d (patch)
treec160c3d7af3a7709fb33224e8344caafe581fcc4 /src/pies.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/pies.c')
-rw-r--r--src/pies.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/pies.c b/src/pies.c
index 36b869a..c5b3649 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -1769,15 +1769,22 @@ int
request_restart_components (size_t cc, char **cv)
{
char **argv;
- size_t i;
+ size_t i, j;
- argv = grecs_calloc (cc + 4, sizeof (*argv));
+ argv = grecs_calloc (5 + 3 * cc - 1, sizeof (*argv));
argv[0] = "piesctl";
argv[1] = "--url";
argv[2] = (char*) pies_control_url ();
+ argv[3] = "restart";
+ j = 4;
for (i = 0; i < cc; i++)
- argv[3 + i] = cv[i];
- argv[3 + i] = NULL;
+ {
+ if (i > 0)
+ argv[j++] = "or";
+ argv[j++] = "component";
+ argv[j++] = cv[i];
+ }
+ argv[j] = NULL;
execvp (argv[0], argv);
logmsg (LOG_ERR, "can't run piesctl: %s", strerror (errno));
return EX_OSFILE;
@@ -2279,6 +2286,8 @@ main (int argc, char **argv)
}
if (action == ACTION_CONT)
{
+ if (children_op & PIES_CHLD_RESCHEDULE_ALARM)
+ progman_recompute_alarm ();
if (children_op & PIES_CHLD_GC)
progman_gc ();
if (children_op & PIES_CHLD_CLEANUP)

Return to:

Send suggestions and report system problems to the System administrator.