Commit 839fda62 authored by spiiroin's avatar spiiroin

[modesetting] Clear timer id when network_retry timer is triggered

When network_retry() timer callback gets triggered, the associated
timer id delayed_network is not invalidated and usb moded can try
to remove it later on - which will lead to complaints from glib
being emitted to journal.

Clear the timer id when the timer callback gets called.

Also make sure already existing timer id is not left active when
scheduling a timeout.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 23ea0403
......@@ -43,7 +43,7 @@
#include "usb_moded-android.h"
static void report_mass_storage_blocker(const char *mountpoint, int try);
guint delayed_network = 0;
static guint delayed_network = 0;
int write_to_file(const char *path, const char *text)
{
......@@ -88,6 +88,7 @@ cleanup:
static gboolean network_retry(gpointer data)
{
delayed_network = 0;
usb_network_up(data);
return(FALSE);
}
......@@ -399,6 +400,8 @@ int set_dynamic_mode(void)
if(network != 0 && data->network)
{
log_debug("Retry setting up the network later\n");
if(delayed_network)
g_source_remove(delayed_network);
delayed_network = g_timeout_add_seconds(3, network_retry, data);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment