Fix a bug about kicking watchdog timer 08/211908/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 12 Aug 2019 03:00:21 +0000 (12:00 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 12 Aug 2019 03:00:21 +0000 (12:00 +0900)
If aul_watchdog_kick() is called immediately after calling
aul_watchdog_enable(), an idle event is started.
Because, the interval of the timer is zero in this time.

Change-Id: I49e2643db2435150a8335242b4376a7d4e762b34
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/aul_watchdog.c

index ad69ee8..7c1d084 100644 (file)
@@ -125,6 +125,11 @@ static gboolean __watchdog_notify_handler(gpointer data)
 
 void aul_watchdog_start(unsigned int interval)
 {
+       if (interval == 0) {
+               _E("Invalid parameter");
+               return;
+       }
+
        if (__context.timer) {
                _W("Timer already exists");
                return;