From 5869b74c2ea17545dc562a5f7ee31d6d397fe65e Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Tue, 14 Mar 2017 16:11:33 +0100 Subject: [PATCH] scan: Don't immediately retry periodic scan on error On a periodic scan trigger error we already set rearm to true, rearm the timer instead of retrying immediately. --- src/scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scan.c b/src/scan.c index bd0134b8..39a53a52 100644 --- a/src/scan.c +++ b/src/scan.c @@ -85,6 +85,7 @@ struct scan_results { }; static bool start_next_scan_request(struct scan_context *sc); +static void scan_periodic_rearm(struct scan_context *sc); static bool scan_context_match(const void *a, const void *b) { @@ -464,9 +465,8 @@ static void scan_periodic_done(struct l_genl_msg *msg, void *user_data) l_warn("Periodic scan could not be triggered: %s (%d)", strerror(-err), -err); - sc->sp.retry = true; - - start_next_scan_request(sc); + if (!start_next_scan_request(sc)) + scan_periodic_rearm(sc); return; }