aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-05-03 18:45:22 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-05-14 09:47:54 +0200
commiteaaf64ffced6e5a870b3f79ff18cf6ee5bb8bb35 (patch)
treed5a6403e94aa3c0ee35a06b7ba0edceaa762a161
parentaaea6c77f28d653bfc37ad47bdc50cbfa2168ce5 (diff)
base-bearer: fix check for cancellation
If we cancel connect_cancellable, the connect task will return a G_IO_ERROR_CANCELLED. We may need to do some cleanup (like, disconnect if the connection went far enough to actually start the network connection), thus it's important we check for cancellation correctly.
-rw-r--r--src/mm-base-bearer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mm-base-bearer.c b/src/mm-base-bearer.c
index 6b7e1e5d..1895788a 100644
--- a/src/mm-base-bearer.c
+++ b/src/mm-base-bearer.c
@@ -709,9 +709,8 @@ connect_ready (MMBaseBearer *self,
mm_dbg ("Couldn't connect bearer '%s': '%s'",
self->priv->path,
error->message);
- if (g_error_matches (error,
- MM_CORE_ERROR,
- MM_CORE_ERROR_CANCELLED)) {
+ if ( g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED)
+ || g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
/* Will launch disconnection */
launch_disconnect = TRUE;
} else