[gnome-settings-daemon/gnome-3-16] rfkill: Make rfkill kernel calls cancellable
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-16] rfkill: Make rfkill kernel calls cancellable
- Date: Tue, 5 Jan 2016 17:26:35 +0000 (UTC)
commit 5080518aae03d1ddfc49af3ba2903dcf43c990f3
Author: Bastien Nocera <hadess hadess net>
Date: Tue Jan 5 15:55:13 2016 +0100
rfkill: Make rfkill kernel calls cancellable
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 efb0dd7..f266c99 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]