[gnome-settings-daemon] power: make sure to set an error when GDBus set_property fails



commit 4e8448ac5c2b7bda014fea602f305d63ffeca1ea
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Mon Mar 9 09:48:16 2015 +0000

    power: make sure to set an error when GDBus set_property fails
    
    If we return FALSE, the API is that the error must be set, and
    GDBus asserts this.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=745920
    Bug-Debian: https://bugs.debian.org/775877
    Reviewed-by: Bastien Nocera

 plugins/power/gsd-power-manager.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 1ebc24d..96f0ed9 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2793,6 +2793,8 @@ handle_set_property (GDBusConnection *connection,
         /* Check session pointer as a proxy for whether the manager is in the
            start or stop state */
         if (manager->priv->session == NULL) {
+                g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+                             "Manager is starting or stopping");
                 return FALSE;
         }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]