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.
This commit is contained in:
Bastien Nocera 2013-10-18 18:43:07 +02:00
parent 5be178ca5b
commit 585ff606c0

View file

@ -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;
}