Просмотр исходного кода

Avoid checking for write permission if just getting value

Abdullah ibn Nadjo 8 лет назад
Родитель
Сommit
9f12ff92a2
1 измененных файлов: 2 добавлений и 1 удалений
  1. 2
    1
      src/light.c

+ 2
- 1
src/light.c Просмотреть файл

670
     return FALSE;
670
     return FALSE;
671
   }
671
   }
672
 
672
 
673
-  if(!light_isWritable(brightnessPath))
673
+  if(light_Configuration.operationMode != LIGHT_GET &&
674
+     !light_isWritable(brightnessPath))
674
   {
675
   {
675
     LIGHT_WARN("could not open controller brightness file for writing, so controller is not accessible");
676
     LIGHT_WARN("could not open controller brightness file for writing, so controller is not accessible");
676
     free(brightnessPath);
677
     free(brightnessPath);