From eaaf64ffced6e5a870b3f79ff18cf6ee5bb8bb35 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 3 May 2019 18:45:22 +0200 Subject: 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(-) (limited to 'src') 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 -- cgit v1.2.3-70-g09d2