summaryrefslogtreecommitdiffstats
path: root/plugins/mbm.c
diff options
context:
space:
mode:
authorTomasz Gregorek <tomasz.gregorek@stericsson.com>2011-01-14 14:35:15 +0100
committerMarcel Holtmann <marcel@holtmann.org>2011-01-14 14:40:47 +0100
commit802b3acbd955de1e4b891a4d94509ec29a6e0711 (patch)
treed330e2f239539e6f0d9202b002c7199c0eb880db /plugins/mbm.c
parentd104573d545016ee1b36e6e884e434ecb241cd1b (diff)
downloadofono-802b3acbd955de1e4b891a4d94509ec29a6e0711.tar.bz2
mbm: Remove data->reopen_source timer before setting up new one
Check if there is a timer running already and remove it before creating a new one. This will prevent calling reopen_callback() more than if mbm_disconnect() is called more than once.
Diffstat (limited to 'plugins/mbm.c')
-rw-r--r--plugins/mbm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mbm.c b/plugins/mbm.c
index 38583ac9..4048f6a9 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -351,6 +351,9 @@ static void mbm_disconnect(gpointer user_data)
data->data_port = NULL;
/* Waiting for the +CGEV: ME DEACT might also work */
+ if (data->reopen_source > 0)
+ g_source_remove(data->reopen_source);
+
data->reopen_source = g_timeout_add_seconds(1, reopen_callback, modem);
}