timer: Fix stopping a running timer 75/23475/2 8.99.5 icefish/8.99.5 icefish_8.99.5
authorRomain Forlot <romain.forlot@iot.bzh>
Fri, 27 Dec 2019 13:30:27 +0000 (14:30 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Fri, 10 Jan 2020 10:54:34 +0000 (11:54 +0100)
commit1d1c6cef6039effd4c045a76d30414b589336d0e
tree3c71bd83eef9745c1c8190278be3504808089702
parent6d828a1b309685ad7f5d74abc0162c59fbbd3304
timer: Fix stopping a running timer

This fix a bug where using 1 don't stop the timer to trigger
and now TimerStop really stop the timer...
sd_event_source_unref only decrement the ref counter of the
sd_event_source. If we want to stop returning -1 in the callback
will make sure we effectively stop the timer instead of only
decrement the ref counter.

Bug-AGL: SPEC-3073

Change-Id: I4619ff1695c398a7c9683b58bd193b8c21b9abb1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
afb-timer.c