Blob Blame History Raw
From 811e7a71fe574884e454807fb59393acc182555c Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Fri, 3 May 2019 18:45:22 +0200
Subject: [PATCH 1/4] 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.
---
 src/mm-base-bearer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mm-base-bearer.c b/src/mm-base-bearer.c
index 854fbc2..e1dd989 100644
--- a/src/mm-base-bearer.c
+++ b/src/mm-base-bearer.c
@@ -576,9 +576,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
-- 
1.8.3.1