From 875c6e1b48f37a07dfbb80d6653c73f205e94260 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 14 Aug 2013 02:55:57 +0200 Subject: backlight: instead of syspath use sysname for identifying backlight devices This makes the description string of the backlight service a bit nicer. --- src/backlight/backlight.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/backlight') 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; } -- cgit v1.2.3-54-g00ecf