From 585ff606c0a096cdd2cb4aed2fe71a6bd71dc273 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 18 Oct 2013 18:43:07 +0200 Subject: daemon: No warning with no LEDs class If there are no LED class devices on the system, no need to print a warning when we cannot open the directory. --- src/up-kbd-backlight.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/up-kbd-backlight.c b/src/up-kbd-backlight.c index d727961..930be11 100644 --- a/src/up-kbd-backlight.c +++ b/src/up-kbd-backlight.c @@ -193,7 +193,8 @@ up_kbd_backlight_find (UpKbdBacklight *kbd_backlight) /* open directory */ dir = g_dir_open ("/sys/class/leds", 0, &error); if (dir == NULL) { - g_warning ("failed to get directory: %s", error->message); + if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) + g_warning ("failed to open directory: %s", error->message); g_error_free (error); goto out; } -- cgit v1.2.1