[gnome-settings-daemon] housekeeping: Fix checking for cancellation
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] housekeeping: Fix checking for cancellation
- Date: Wed, 16 Mar 2016 11:15:00 +0000 (UTC)
commit 97a95f0060700659e12cd99eb824174d8b1230b8
Author: Bastien Nocera <hadess hadess net>
Date: Tue Mar 15 14:56:31 2016 +0100
housekeeping: Fix checking for cancellation
We really don't need to call g_cancellable_is_cancelled() when we could
just check the error code we get back.
https://bugzilla.gnome.org/show_bug.cgi?id=763689
plugins/housekeeping/gsd-housekeeping-manager.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c
index df0ff3a..aa3c769 100644
--- a/plugins/housekeeping/gsd-housekeeping-manager.c
+++ b/plugins/housekeeping/gsd-housekeeping-manager.c
@@ -334,15 +334,10 @@ on_bus_gotten (GObject *source_object,
GDBusInterfaceInfo **infos;
int i;
- if (manager->priv->bus_cancellable == NULL ||
- g_cancellable_is_cancelled (manager->priv->bus_cancellable)) {
- g_warning ("Operation has been cancelled, so not retrieving session bus");
- return;
- }
-
connection = g_bus_get_finish (res, &error);
if (connection == NULL) {
- g_warning ("Could not get session bus: %s", error->message);
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ g_warning ("Could not get session bus: %s", error->message);
g_error_free (error);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]