summaryrefslogtreecommitdiff
path: root/src/backlight
diff options
context:
space:
mode:
Diffstat (limited to 'src/backlight')
-rw-r--r--src/backlight/backlight.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 3378907f91..1ef0b45cc6 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -54,9 +54,15 @@ int main(int argc, char *argv[]) {
goto finish;
}
- device = udev_device_new_from_syspath(udev, argv[2]);
+ errno = 0;
+ device = udev_device_new_from_subsystem_sysname(udev, "backlight", argv[2]);
if (!device) {
- r = log_oom();
+ if (errno != 0) {
+ log_error("Failed to get backlight device: %m");
+ r = -errno;
+ } else
+ r = log_oom();
+
goto finish;
}