Browse Source

Fix unclosed DIR when targeting keyboard

Abdullah ibn Nadjo 7 years ago
parent
commit
01e73a2d3d
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      src/light.c

+ 4
- 1
src/light.c View File

695
 
695
 
696
   if(light_iteratorDir == NULL)
696
   if(light_iteratorDir == NULL)
697
   {
697
   {
698
-    light_iteratorDir = opendir("/sys/class/backlight");
699
     if(light_Configuration.target == LIGHT_KEYBOARD)
698
     if(light_Configuration.target == LIGHT_KEYBOARD)
700
     {
699
     {
701
       light_iteratorDir = opendir("/sys/class/leds");
700
       light_iteratorDir = opendir("/sys/class/leds");
702
     }
701
     }
702
+    else
703
+    {
704
+      light_iteratorDir = opendir("/sys/class/backlight");
705
+    }
703
     if(light_iteratorDir == NULL)
706
     if(light_iteratorDir == NULL)
704
     {
707
     {
705
       LIGHT_ERR("could not open backlight or leds directory");
708
       LIGHT_ERR("could not open backlight or leds directory");