diff options
author | Bastien Nocera <hadess@hadess.net> | 2016-01-05 15:55:13 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2016-01-05 15:55:13 +0100 |
commit | 750d7e0c2224c7b323090b672b49c1ffea56591a (patch) | |
tree | 2a9c3f93f68b0f605ce6078627373dd3a3bee6d3 | |
parent | 11587b52e1c701abd0668a4a4107c8979a01e451 (diff) | |
download | gnome-settings-daemon-750d7e0c2224c7b323090b672b49c1ffea56591a.tar.gz |
rfkill: Make rfkill kernel calls cancellable
-rw-r--r-- | plugins/rfkill/gsd-rfkill-manager.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/rfkill/gsd-rfkill-manager.c b/plugins/rfkill/gsd-rfkill-manager.c index efb0dd7a..f266c998 100644 --- a/plugins/rfkill/gsd-rfkill-manager.c +++ b/plugins/rfkill/gsd-rfkill-manager.c @@ -303,7 +303,8 @@ rfkill_set_cb (GObject *source_object, ret = cc_rfkill_glib_send_event_finish (CC_RFKILL_GLIB (source_object), res, &error); if (!ret) { - g_warning ("Failed to set RFKill: %s", error->message); + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_warning ("Failed to set RFKill: %s", error->message); g_error_free (error); } } @@ -339,7 +340,8 @@ engine_set_bluetooth_airplane_mode (GsdRfkillManager *manager, event.op = RFKILL_OP_CHANGE_ALL; event.type = RFKILL_TYPE_BLUETOOTH; event.soft = enable ? 1 : 0; - cc_rfkill_glib_send_event (manager->priv->rfkill, &event, NULL, rfkill_set_cb, manager); + cc_rfkill_glib_send_event (manager->priv->rfkill, &event, + manager->priv->cancellable, rfkill_set_cb, manager); return TRUE; } @@ -354,7 +356,8 @@ engine_set_airplane_mode (GsdRfkillManager *manager, event.op = RFKILL_OP_CHANGE_ALL; event.type = RFKILL_TYPE_ALL; event.soft = enable ? 1 : 0; - cc_rfkill_glib_send_event (manager->priv->rfkill, &event, NULL, rfkill_set_cb, manager); + cc_rfkill_glib_send_event (manager->priv->rfkill, &event, + manager->priv->cancellable, rfkill_set_cb, manager); /* Note: we set the the NM property even if there are no modems, so we don't need to resync when one is plugged in */ |