summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-08-14 02:55:57 +0200
committerLennart Poettering <lennart@poettering.net>2013-08-14 02:55:57 +0200
commit875c6e1b48f37a07dfbb80d6653c73f205e94260 (patch)
tree92f0810adac8e3387c7a9dd66cdcf47d6629fbff /src
parent3731acf1acfb4a6eb68374a5b137f3b368f63381 (diff)
backlight: instead of syspath use sysname for identifying backlight devices
This makes the description string of the backlight service a bit nicer.
Diffstat (limited to 'src')
-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;
}