summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctl-lib/ctl-timer.c')
-rw-r--r--ctl-lib/ctl-timer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ctl-lib/ctl-timer.c b/ctl-lib/ctl-timer.c
index 9cab0b2..e1ced46 100644
--- a/ctl-lib/ctl-timer.c
+++ b/ctl-lib/ctl-timer.c
@@ -36,6 +36,9 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
int done;
uint64_t usec;
+ done= timerHandle->callback(timerHandle);
+ if (!done) goto OnErrorExit;
+
// Rearm timer if needed
timerHandle->count --;
if (timerHandle->count == 0) {
@@ -51,9 +54,6 @@ STATIC int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
sd_event_source_set_time(source, usec + timerHandle->delay*1000);
}
- done= timerHandle->callback(timerHandle->context);
- if (!done) goto OnErrorExit;
-
return 0;
OnErrorExit: