aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@nxc.no>2013-12-03 09:27:44 +0200
committerSergey Poznyakoff <gray@nxc.no>2013-12-03 09:27:44 +0200
commitcbb1ff8d1596c8477020a1b3ba9252a63cb5b958 (patch)
tree77865fc29e72495695db0c5a14db7eb7e19a9967
parent23b68c5e5e03003c6a37d98bde129494c534e642 (diff)
downloadjumper-cbb1ff8d1596c8477020a1b3ba9252a63cb5b958.tar.gz
jumper-cbb1ff8d1596c8477020a1b3ba9252a63cb5b958.tar.bz2
Bugfix.
Make sure that running startup and cleanup actions properly updates listener act_count. * src/listener.c (listener_run_action): Use runaction. (runaction): Return error status.
-rw-r--r--src/listener.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/listener.c b/src/listener.c
index 7a20f6d..8b96985 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -276,6 +276,8 @@ event_match(action_t *act, enum event_type type, int code)
return evt;
}
+static int runaction(listener_t *lp, action_t *act, event_t *evt);
+
int
listener_run_action(int a)
{
@@ -292,13 +294,8 @@ listener_run_action(int a)
NULL);
for (act = lp->act_head; act; act = act->next) {
- if (event_match_type(act, a) &&
- progman_start(type_action, lp,
- &act->locus,
- act->options,
- act->timeout,
- act->command,
- act->env, kve))
+ event_t *evt = event_match_type(act, a);
+ if (evt && runaction(lp, act, evt))
err++;
}
}
@@ -419,7 +416,7 @@ listener_print_status(listener_t *lp)
lp->status = stat_down;
}
-static void
+static int
runaction(listener_t *lp, action_t *act, event_t *evt)
{
char *kve[KVE_MINSIZE + 6];
@@ -437,9 +434,10 @@ runaction(listener_t *lp, action_t *act, event_t *evt)
if (progman_start(type_action, lp, &act->locus, act->options,
act->timeout, act->command, act->env, kve))
- return;
+ return 1;
lp->act_count++;
+ return 0;
}
void

Return to:

Send suggestions and report system problems to the System administrator.