diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-03 17:20:29 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-04 10:21:44 +0200 |
commit | 72db2a53ed114a6b46515130a6ed8238eba35bfe (patch) | |
tree | d7edf7f15716a137b07a4007a2c87c5b426a7410 /src | |
parent | 9c2a6320a82aa301b2415227741a8bff5a33ea1b (diff) |
plugin: defer task if supports check tells us to retry
Huawei modems will probe interface 0 always first; if we try to probe another
interface meanwhile the supports check will give us a MM_CORE_ERROR_RETRY error,
indicating that we need to defer the probing of the port.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-plugin.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c index a8009976..8db4c049 100644 --- a/src/mm-plugin.c +++ b/src/mm-plugin.c @@ -477,8 +477,18 @@ port_probe_run_ready (MMPortProbe *probe, g_simple_async_result_set_op_res_gpointer (ctx->result, GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED), NULL); - } else { - /* For remaining errors, just propagate them */ + } + /* Probing failed but the plugin tells us to retry; so we'll defer the + * probing a bit */ + else if (g_error_matches (error, + MM_CORE_ERROR, + MM_CORE_ERROR_RETRY)) { + g_simple_async_result_set_op_res_gpointer (ctx->result, + GUINT_TO_POINTER (MM_PLUGIN_SUPPORTS_PORT_DEFER), + NULL); + } + /* For remaining errors, just propagate them */ + else { g_simple_async_result_take_error (ctx->result, error); } } else { |