summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-10-18 18:43:07 +0200
committerBastien Nocera <hadess@hadess.net>2013-10-18 18:43:07 +0200
commit585ff606c0a096cdd2cb4aed2fe71a6bd71dc273 (patch)
tree3d617247967dd311e01f66e775c095faee20afe3
parent5be178ca5b770356d0412aff87e4696ff1a1afdf (diff)
downloadupower-585ff606c0a096cdd2cb4aed2fe71a6bd71dc273.tar.gz
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.
-rw-r--r--src/up-kbd-backlight.c3
1 files changed, 2 insertions, 1 deletions
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;
}