summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2018-03-05 16:02:24 +0100
committerThomas Haller <thaller@redhat.com>2018-03-08 14:52:45 +0100
commit26c215e22dcfff9e61a58e9348991ed77c3f8861 (patch)
treeab7cbe276d8fc3dcc12ed677294fa0c85396f94f
parentd76cfa3814915cc12c7af9e7bdc4d7ac3dc71e49 (diff)
Add calls to g_simple_async_result_set_check_cancellable
If an operation is cancelled through the GCancellable, then the idiom is that the operation is always cancelled, even if it has finished successfully. To ensure this is the case, add calls to g_simple_async_result_set_check_cancellable everywhere. Without this, e.g. gnome-control-center will crash when switching away from the power panel quickly, as the NMClient creation finishes asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to ensure it doesn't access the now invalid user_data parameter. https://bugzilla.gnome.org/show_bug.cgi?id=794088
-rw-r--r--clients/common/nm-polkit-listener.c2
-rw-r--r--libnm-glib/nm-client.c6
-rw-r--r--libnm-glib/nm-object.c2
-rw-r--r--libnm-glib/nm-remote-connection.c2
-rw-r--r--libnm-glib/nm-remote-settings.c4
-rw-r--r--libnm/nm-client.c26
-rw-r--r--libnm/nm-dbus-helpers.c2
-rw-r--r--libnm/nm-device-wifi.c2
-rw-r--r--libnm/nm-device.c8
-rw-r--r--libnm/nm-manager.c16
-rw-r--r--libnm/nm-object.c2
-rw-r--r--libnm/nm-remote-connection.c12
-rw-r--r--libnm/nm-remote-settings.c8
-rw-r--r--libnm/nm-secret-agent-old.c6
14 files changed, 98 insertions, 0 deletions
diff --git a/clients/common/nm-polkit-listener.c b/clients/common/nm-polkit-listener.c
index 9c67760bf..69f490624 100644
--- a/clients/common/nm-polkit-listener.c
+++ b/clients/common/nm-polkit-listener.c
@@ -205,6 +205,8 @@ initiate_authentication (PolkitAgentListener *listener,
callback,
user_data,
initiate_authentication);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
if (priv->active_session != NULL) {
g_simple_async_result_set_error (simple,
POLKIT_ERROR,
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index 183cdc933..ad9069836 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -1612,6 +1612,8 @@ nm_client_check_connectivity_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_check_connectivity_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
g_simple_async_result_set_op_res_gpointer (simple, ccd, (GDestroyNotify) check_connectivity_data_free);
if (cancellable) {
@@ -1738,6 +1740,8 @@ nm_client_new_async (GCancellable *cancellable,
}
simple = g_simple_async_result_new (NULL, callback, user_data, nm_client_new_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
g_async_initable_init_async (G_ASYNC_INITABLE (client), G_PRIORITY_DEFAULT,
cancellable, client_inited, simple);
}
@@ -2001,6 +2005,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data->client = NM_CLIENT (initable);
init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback,
user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->result, cancellable);
g_simple_async_result_set_op_res_gboolean (init_data->result, TRUE);
/* Check if NM is running */
diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c
index 2e07ff6d1..d3f8c830e 100644
--- a/libnm-glib/nm-object.c
+++ b/libnm-glib/nm-object.c
@@ -303,6 +303,8 @@ init_async (GAsyncInitable *initable, int io_priority,
GSimpleAsyncResult *simple;
simple = g_simple_async_result_new (G_OBJECT (initable), callback, user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
/* Check if NM is running */
dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner",
diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c
index 7e60ea953..820f9e5ca 100644
--- a/libnm-glib/nm-remote-connection.c
+++ b/libnm-glib/nm-remote-connection.c
@@ -713,6 +713,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data->connection = NM_REMOTE_CONNECTION (initable);
init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback,
user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->result, cancellable);
dbus_g_proxy_begin_call (priv->proxy, "GetSettings",
init_get_settings_cb, init_data, NULL,
diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c
index 3f2c50f24..be6b7ee3b 100644
--- a/libnm-glib/nm-remote-settings.c
+++ b/libnm-glib/nm-remote-settings.c
@@ -1115,6 +1115,8 @@ nm_remote_settings_new_async (DBusGConnection *bus, GCancellable *cancellable,
GSimpleAsyncResult *simple;
simple = g_simple_async_result_new (NULL, callback, user_data, nm_remote_settings_new_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
self = g_object_new (NM_TYPE_REMOTE_SETTINGS,
NM_REMOTE_SETTINGS_BUS, bus,
@@ -1367,6 +1369,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data->settings = NM_REMOTE_SETTINGS (initable);
init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback,
user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->result, cancellable);
/* Check if NM is running */
dbus_g_proxy_begin_call (priv->dbus_proxy, "NameHasOwner",
diff --git a/libnm/nm-client.c b/libnm/nm-client.c
index 6936c53fe..9218df52b 100644
--- a/libnm/nm-client.c
+++ b/libnm/nm-client.c
@@ -720,6 +720,8 @@ nm_client_check_connectivity_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_check_connectivity_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_manager_check_connectivity_async (NM_CLIENT_GET_PRIVATE (client)->manager,
cancellable, check_connectivity_cb, simple);
}
@@ -829,6 +831,8 @@ nm_client_save_hostname_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_save_hostname_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_remote_settings_save_hostname_async (NM_CLIENT_GET_PRIVATE (client)->settings,
hostname,
cancellable, save_hostname_cb, simple);
@@ -1116,6 +1120,8 @@ nm_client_activate_connection_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_activate_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_manager_activate_connection_async (NM_CLIENT_GET_PRIVATE (client)->manager,
connection, device, specific_object,
cancellable, activate_cb, simple);
@@ -1221,6 +1227,8 @@ nm_client_add_and_activate_connection_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_add_and_activate_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_manager_add_and_activate_connection_async (NM_CLIENT_GET_PRIVATE (client)->manager,
partial, device, specific_object,
cancellable, add_activate_cb, simple);
@@ -1324,6 +1332,8 @@ nm_client_deactivate_connection_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_deactivate_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
if (!_nm_client_check_nm_running (client, NULL)) {
g_simple_async_result_set_op_res_gboolean (simple, TRUE);
@@ -1530,6 +1540,8 @@ nm_client_add_connection_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_add_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_remote_settings_add_connection_async (NM_CLIENT_GET_PRIVATE (client)->settings,
connection, save_to_disk,
cancellable, add_connection_cb, simple);
@@ -1655,6 +1667,8 @@ nm_client_load_connections_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_load_connections_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_remote_settings_load_connections_async (NM_CLIENT_GET_PRIVATE (client)->settings,
filenames,
cancellable, load_connections_cb, simple);
@@ -1767,6 +1781,8 @@ nm_client_reload_connections_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_reload_connections_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_remote_settings_reload_connections_async (NM_CLIENT_GET_PRIVATE (client)->settings,
cancellable, reload_connections_cb, simple);
}
@@ -1933,6 +1949,8 @@ nm_client_new_async (GCancellable *cancellable,
GSimpleAsyncResult *simple;
simple = g_simple_async_result_new (NULL, callback, user_data, nm_client_new_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
g_async_initable_new_async (NM_TYPE_CLIENT, G_PRIORITY_DEFAULT,
cancellable, client_inited, simple,
@@ -2141,6 +2159,8 @@ nm_client_checkpoint_create_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_checkpoint_create_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_manager_checkpoint_create_async (NM_CLIENT_GET_PRIVATE (client)->manager,
devices, rollback_timeout, flags,
cancellable, checkpoint_create_cb, simple);
@@ -2224,6 +2244,8 @@ nm_client_checkpoint_destroy_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_checkpoint_destroy_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_manager_checkpoint_destroy_async (NM_CLIENT_GET_PRIVATE (client)->manager,
checkpoint,
cancellable, checkpoint_destroy_cb, simple);
@@ -2309,6 +2331,8 @@ nm_client_checkpoint_rollback_async (NMClient *client,
simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
nm_client_checkpoint_rollback_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nm_manager_checkpoint_rollback_async (NM_CLIENT_GET_PRIVATE (client)->manager,
checkpoint,
cancellable, checkpoint_rollback_cb, simple);
@@ -2856,6 +2880,8 @@ prepare_object_manager (NMClient *client,
init_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
init_data->result = g_simple_async_result_new (G_OBJECT (client), callback,
user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->result, cancellable);
g_simple_async_result_set_op_res_gboolean (init_data->result, TRUE);
g_dbus_object_manager_client_new_for_bus (_nm_dbus_bus_type (),
diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c
index f835b5914..90818a14c 100644
--- a/libnm/nm-dbus-helpers.c
+++ b/libnm/nm-dbus-helpers.c
@@ -74,6 +74,8 @@ _nm_dbus_new_connection_async (GCancellable *cancellable,
GSimpleAsyncResult *simple;
simple = g_simple_async_result_new (NULL, callback, user_data, _nm_dbus_new_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
g_bus_get (_nm_dbus_bus_type (),
cancellable,
diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c
index c85809dd5..e4ea94e96 100644
--- a/libnm/nm-device-wifi.c
+++ b/libnm/nm-device-wifi.c
@@ -407,6 +407,8 @@ _device_wifi_request_scan_async (NMDeviceWifi *device,
simple = g_simple_async_result_new (G_OBJECT (device), callback, user_data,
nm_device_wifi_request_scan_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
/* If a scan is in progress, just return */
if (priv->scan_info) {
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index 6d01ec3b1..4d530f78b 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -2007,6 +2007,8 @@ nm_device_reapply_async (NMDevice *device,
simple = g_simple_async_result_new (G_OBJECT (device), callback, user_data,
nm_device_reapply_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_device_call_reapply (NM_DEVICE_GET_PRIVATE (device)->proxy,
dict, version_id, flags, cancellable,
@@ -2170,6 +2172,8 @@ nm_device_get_applied_connection_async (NMDevice *device,
simple = g_simple_async_result_new (G_OBJECT (device), callback, user_data,
nm_device_get_applied_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_device_call_get_applied_connection (NM_DEVICE_GET_PRIVATE (device)->proxy,
flags, cancellable,
@@ -2291,6 +2295,8 @@ nm_device_disconnect_async (NMDevice *device,
simple = g_simple_async_result_new (G_OBJECT (device), callback, user_data,
nm_device_disconnect_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_device_call_disconnect (NM_DEVICE_GET_PRIVATE (device)->proxy,
cancellable,
@@ -2392,6 +2398,8 @@ nm_device_delete_async (NMDevice *device,
simple = g_simple_async_result_new (G_OBJECT (device), callback, user_data,
nm_device_delete_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_device_call_delete (NM_DEVICE_GET_PRIVATE (device)->proxy,
cancellable,
diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c
index a4acf7658..6ad5ad9d3 100644
--- a/libnm/nm-manager.c
+++ b/libnm/nm-manager.c
@@ -743,6 +743,8 @@ nm_manager_check_connectivity_async (NMManager *manager,
simple = g_simple_async_result_new (G_OBJECT (manager), callback, user_data,
nm_manager_check_connectivity_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_manager_call_check_connectivity (priv->proxy,
cancellable,
check_connectivity_cb, simple);
@@ -1026,6 +1028,8 @@ nm_manager_activate_connection_async (NMManager *manager,
info->manager = manager;
info->simple = g_simple_async_result_new (G_OBJECT (manager), callback, user_data,
nm_manager_activate_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (info->simple, cancellable);
info->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
c_list_link_tail (&priv->pending_activations, &info->lst);
@@ -1103,6 +1107,8 @@ nm_manager_add_and_activate_connection_async (NMManager *manager,
info->manager = manager;
info->simple = g_simple_async_result_new (G_OBJECT (manager), callback, user_data,
nm_manager_add_and_activate_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (info->simple, cancellable);
info->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
c_list_link_tail (&priv->pending_activations, &info->lst);
@@ -1250,6 +1256,8 @@ nm_manager_deactivate_connection_async (NMManager *manager,
simple = g_simple_async_result_new (G_OBJECT (manager), callback, user_data,
nm_manager_deactivate_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
path = nm_object_get_path (NM_OBJECT (active));
nmdbus_manager_call_deactivate_connection (NM_MANAGER_GET_PRIVATE (manager)->proxy,
@@ -1353,6 +1361,8 @@ nm_manager_checkpoint_create_async (NMManager *manager,
info->manager = manager;
info->simple = g_simple_async_result_new (G_OBJECT (manager), callback, user_data,
nm_manager_checkpoint_create_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (info->simple, cancellable);
paths = get_device_paths (devices);
nmdbus_manager_call_checkpoint_create (NM_MANAGER_GET_PRIVATE (manager)->proxy,
paths,
@@ -1415,6 +1425,8 @@ nm_manager_checkpoint_destroy_async (NMManager *manager,
simple = g_simple_async_result_new (G_OBJECT (manager), callback, user_data,
nm_manager_checkpoint_destroy_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
path = nm_object_get_path (NM_OBJECT (checkpoint));
nmdbus_manager_call_checkpoint_destroy (NM_MANAGER_GET_PRIVATE (manager)->proxy,
@@ -1486,6 +1498,8 @@ nm_manager_checkpoint_rollback_async (NMManager *manager,
simple = g_simple_async_result_new (G_OBJECT (manager), callback, user_data,
nm_manager_checkpoint_rollback_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
path = nm_object_get_path (NM_OBJECT (checkpoint));
nmdbus_manager_call_checkpoint_rollback (NM_MANAGER_GET_PRIVATE (manager)->proxy,
@@ -1607,6 +1621,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback,
user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->result, cancellable);
g_simple_async_result_set_op_res_gboolean (init_data->result, TRUE);
nm_manager_parent_async_initable_iface->init_async (initable, io_priority, cancellable,
diff --git a/libnm/nm-object.c b/libnm/nm-object.c
index 4fa9b7bd3..fc7a82af9 100644
--- a/libnm/nm-object.c
+++ b/libnm/nm-object.c
@@ -1132,6 +1132,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data = g_slice_new0 (NMObjectInitData);
init_data->object = self;
init_data->simple = g_simple_async_result_new (G_OBJECT (initable), callback, user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->simple, cancellable);
init_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
interfaces = g_dbus_object_get_interfaces (priv->object);
diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c
index 3f6ebb3b2..312b17ebe 100644
--- a/libnm/nm-remote-connection.c
+++ b/libnm/nm-remote-connection.c
@@ -125,6 +125,8 @@ nm_remote_connection_update2 (NMRemoteConnection *connection,
simple = g_simple_async_result_new (G_OBJECT (connection), callback, user_data,
nm_remote_connection_update2);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
if (!settings) {
g_variant_builder_init (&builder, NM_VARIANT_TYPE_CONNECTION);
@@ -266,6 +268,8 @@ nm_remote_connection_commit_changes_async (NMRemoteConnection *connection,
simple = g_simple_async_result_new (G_OBJECT (connection), callback, user_data,
nm_remote_connection_commit_changes_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
g_variant_builder_init (&args, G_VARIANT_TYPE ("a{sv}"));
nmdbus_settings_connection_call_update2 (priv->proxy,
@@ -379,6 +383,8 @@ nm_remote_connection_save_async (NMRemoteConnection *connection,
simple = g_simple_async_result_new (G_OBJECT (connection), callback, user_data,
nm_remote_connection_save_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_settings_connection_call_save (priv->proxy, cancellable, save_cb, simple);
}
@@ -479,6 +485,8 @@ nm_remote_connection_delete_async (NMRemoteConnection *connection,
simple = g_simple_async_result_new (G_OBJECT (connection), callback, user_data,
nm_remote_connection_delete_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_settings_connection_call_delete (priv->proxy, cancellable, delete_cb, simple);
}
@@ -591,6 +599,8 @@ nm_remote_connection_get_secrets_async (NMRemoteConnection *connection,
simple = g_simple_async_result_new (G_OBJECT (connection), callback, user_data,
nm_remote_connection_get_secrets_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_settings_connection_call_get_secrets (priv->proxy,
setting_name,
@@ -832,6 +842,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback,
user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->result, cancellable);
init_data->initable = initable;
init_data->io_priority = io_priority;
diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c
index 4d8464249..2339e872a 100644
--- a/libnm/nm-remote-settings.c
+++ b/libnm/nm-remote-settings.c
@@ -315,6 +315,8 @@ nm_remote_settings_add_connection_async (NMRemoteSettings *settings,
info->self = settings;
info->simple = g_simple_async_result_new (G_OBJECT (settings), callback, user_data,
nm_remote_settings_add_connection_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (info->simple, cancellable);
info->saved = save_to_disk;
new_settings = nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL);
@@ -415,6 +417,8 @@ nm_remote_settings_load_connections_async (NMRemoteSettings *settings,
simple = g_simple_async_result_new (G_OBJECT (settings), callback, user_data,
nm_remote_settings_load_connections_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_settings_call_load_connections (priv->proxy,
(const char * const *) filenames,
@@ -497,6 +501,8 @@ nm_remote_settings_reload_connections_async (NMRemoteSettings *settings,
simple = g_simple_async_result_new (G_OBJECT (settings), callback, user_data,
nm_remote_settings_reload_connections_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_settings_call_reload_connections (priv->proxy, cancellable,
reload_connections_cb, simple);
@@ -574,6 +580,8 @@ nm_remote_settings_save_hostname_async (NMRemoteSettings *settings,
simple = g_simple_async_result_new (G_OBJECT (settings), callback, user_data,
nm_remote_settings_save_hostname_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
nmdbus_settings_call_save_hostname (priv->proxy,
hostname ? hostname : "",
diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c
index 8646372ba..20324045d 100644
--- a/libnm/nm-secret-agent-old.c
+++ b/libnm/nm-secret-agent-old.c
@@ -681,6 +681,8 @@ nm_secret_agent_old_register_async (NMSecretAgentOld *self,
simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
nm_secret_agent_old_register_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
if (!check_nm_running (self, &error)) {
g_simple_async_result_take_error (simple, error);
@@ -824,6 +826,8 @@ nm_secret_agent_old_unregister_async (NMSecretAgentOld *self,
simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
nm_secret_agent_old_unregister_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
if (!check_nm_running (self, &error)) {
g_simple_async_result_take_error (simple, error);
@@ -1157,6 +1161,8 @@ init_async (GAsyncInitable *initable, int io_priority,
init_data->simple = g_simple_async_result_new (G_OBJECT (initable), callback,
user_data, init_async);
+ if (cancellable)
+ g_simple_async_result_set_check_cancellable (init_data->simple, cancellable);
_nm_dbus_new_connection_async (cancellable, init_async_got_bus, init_data);
}