diff options
-rw-r--r-- | src/sna/sna_display.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 521d4ef4..15b27e40 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -445,6 +445,7 @@ sna_output_backlight_get_max(xf86OutputPtr output) { struct sna_output *sna_output = output->driver_private; char path[1024], val[BACKLIGHT_VALUE_LEN]; + struct stat st; int fd, max = 0; /* We are used as an initial check to see if we can @@ -455,6 +456,12 @@ sna_output_backlight_get_max(xf86OutputPtr output) if (access(path, R_OK | W_OK)) return -1; + if (stat(path, &st)) + return -1; + + if (major(st.st_dev)) /* is this a kernel psuedo filesystem? */ + return -1; + sprintf(path, "%s/%s/max_brightness", BACKLIGHT_CLASS, sna_output->backlight_iface); fd = open(path, O_RDONLY); |