From 10669881a5520c253ab8ba6f05de4ff5afdc7a31 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 5 Mar 2012 16:10:53 +0100 Subject: [PATCH] iface-modem-time: only retry if MM_CORE_ERROR_RETRY was returned We don't want to retry if the error is fatal in some other kind, e.g. a reply parsing error or something. --- src/mm-iface-modem-time.c | 7 +++++-- src/mm-iface-modem-time.h | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mm-iface-modem-time.c b/src/mm-iface-modem-time.c index a7763fff..2e200f59 100644 --- a/src/mm-iface-modem-time.c +++ b/src/mm-iface-modem-time.c @@ -137,8 +137,11 @@ load_network_timezone_ready (MMIfaceModemTime *self, /* Retry? */ ctx->network_timezone_poll_retries--; - /* Fatal if no more retries */ - if (ctx->network_timezone_poll_retries == 0) { + /* Fatal if no more retries, or if specific error is not RETRY */ + if (ctx->network_timezone_poll_retries == 0 || + !g_error_matches (error, + MM_CORE_ERROR, + MM_CORE_ERROR_RETRY)) { g_simple_async_result_take_error (ctx->result, error); update_network_timezone_context_complete_and_free (ctx); return; diff --git a/src/mm-iface-modem-time.h b/src/mm-iface-modem-time.h index 013d5ab9..b47732ef 100644 --- a/src/mm-iface-modem-time.h +++ b/src/mm-iface-modem-time.h @@ -39,7 +39,9 @@ struct _MMIfaceModemTime { GAsyncResult *res, GError **error); - /* Loading of the network timezone property */ + /* Loading of the network timezone property. This method may return + * MM_CORE_ERROR_RETRY if the timezone cannot yet be loaded, so that + * the interface retries later. */ void (* load_network_timezone) (MMIfaceModemTime *self, GAsyncReadyCallback callback, gpointer user_data);