From da747252563b94069ccc7fa6882bc608bb84053d Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Mon, 10 Nov 2014 13:59:27 +0100 Subject: be_ptask: handle OFFLINE_DISABLE mode before task execution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Lukáš Slebodník --- src/providers/dp_ptask.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/providers/dp_ptask.c b/src/providers/dp_ptask.c index d8734b2f3..5a14e60b2 100644 --- a/src/providers/dp_ptask.c +++ b/src/providers/dp_ptask.c @@ -109,7 +109,10 @@ static void be_ptask_execute(struct tevent_context *ev, be_ptask_schedule(task, task->period, BE_PTASK_SCHEDULE_FROM_NOW); return; case BE_PTASK_OFFLINE_DISABLE: - /* This case is handled by offline callback. */ + /* This case is normally handled by offline callback but we + * should handle it here as well since we can get here in some + * special cases for example unit tests or tevent events order. */ + be_ptask_disable(task); return; case BE_PTASK_OFFLINE_EXECUTE: /* continue */ -- cgit