summaryrefslogtreecommitdiffstats
path: root/debian/patches/supplicant-use-nm_clear_g_cancellable-helper.patch
blob: 3db669e727d7542c116b6a92d0450d0c8df98bcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 15 Feb 2017 00:16:38 +0100
Subject: supplicant: use nm_clear_g_cancellable() helper

(cherry picked from commit da34034b95651d8b68eaa19d7bf115ffc1cd1fb5)
---
 src/supplicant/nm-supplicant-interface.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/supplicant/nm-supplicant-interface.c b/src/supplicant/nm-supplicant-interface.c
index 35fe7db..725f6d4 100644
--- a/src/supplicant/nm-supplicant-interface.c
+++ b/src/supplicant/nm-supplicant-interface.c
@@ -271,20 +271,11 @@ set_state (NMSupplicantInterface *self, NMSupplicantInterfaceState new_state)
 		g_return_if_fail (new_state > NM_SUPPLICANT_INTERFACE_STATE_READY);
 
 	if (new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) {
-		if (priv->other_cancellable) {
-			g_warn_if_fail (priv->other_cancellable == NULL);
-			g_cancellable_cancel (priv->other_cancellable);
-			g_clear_object (&priv->other_cancellable);
-		}
+		nm_clear_g_cancellable (&priv->other_cancellable);
 		priv->other_cancellable = g_cancellable_new ();
 	} else if (new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) {
-		if (priv->init_cancellable)
-			g_cancellable_cancel (priv->init_cancellable);
-		g_clear_object (&priv->init_cancellable);
-
-		if (priv->other_cancellable)
-			g_cancellable_cancel (priv->other_cancellable);
-		g_clear_object (&priv->other_cancellable);
+		nm_clear_g_cancellable (&priv->init_cancellable);
+		nm_clear_g_cancellable (&priv->other_cancellable);
 
 		if (priv->iface_proxy)
 			g_signal_handlers_disconnect_by_data (priv->iface_proxy, self);
@@ -970,8 +961,7 @@ interface_add (NMSupplicantInterface *self)
 	/* Move to starting to prevent double-calls of interface_add() */
 	set_state (self, NM_SUPPLICANT_INTERFACE_STATE_STARTING);
 
-	g_warn_if_fail (priv->init_cancellable == NULL);
-	g_clear_object (&priv->init_cancellable);
+	nm_clear_g_cancellable (&priv->init_cancellable);
 	priv->init_cancellable = g_cancellable_new ();
 
 	g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,