[gnome-settings-daemon/wip/hadess/power-add-coarse-level-support] power: Don't throw warnings when systemd is too old



commit 49c855d66659b45672c0a795e1139f6413d31896
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 27 12:57:13 2019 +0100

    power: Don't throw warnings when systemd is too old
    
    We still have a fallback mechanism, so don't be noisy if systemd is too
    old.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/475

 plugins/power/gsd-backlight.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/plugins/power/gsd-backlight.c b/plugins/power/gsd-backlight.c
index f4d60306..f14ca533 100644
--- a/plugins/power/gsd-backlight.c
+++ b/plugins/power/gsd-backlight.c
@@ -848,6 +848,11 @@ gsd_backlight_initable_init (GInitable       *initable,
                          * this is expected.
                          */
                         g_clear_error (&logind_error);
+                } else if (g_error_matches (logind_error, G_DBUS_ERROR,
+                                            G_DBUS_ERROR_UNKNOWN_METHOD)) {
+                        /* systemd version is too old, so ignore.
+                         */
+                        g_clear_error (&logind_error);
                 } else {
                         /* Fail on anything else */
                         g_clear_object (&backlight->logind_proxy);


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