Skip to content

Commit 77f6983

Browse files
author
Reini Urban
committed
led: print full brightness device paths on errors
Signed-off-by: Reini Urban <[email protected]>
1 parent 258bfcf commit 77f6983

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/led/led.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ mraa_led_get_brightfd(mraa_led_context dev)
4444
snprintf(buf, MAX_SIZE, "%s/%s", dev->led_path, "brightness");
4545
dev->bright_fd = open(buf, O_RDWR);
4646
if (dev->bright_fd == -1) {
47-
syslog(LOG_ERR, "led: brightness: Failed to open 'brightness': %s", strerror(errno));
47+
syslog(LOG_ERR, "led: brightness: Failed to open %s: %s", buf, strerror(errno));
4848
return MRAA_ERROR_INVALID_RESOURCE;
4949
}
5050

@@ -59,7 +59,7 @@ mraa_led_get_maxbrightfd(mraa_led_context dev)
5959
snprintf(buf, MAX_SIZE, "%s/%s", dev->led_path, "max_brightness");
6060
dev->max_bright_fd = open(buf, O_RDONLY);
6161
if (dev->max_bright_fd == -1) {
62-
syslog(LOG_ERR, "led: max_brightness: Failed to open 'max_brightness': %s", strerror(errno));
62+
syslog(LOG_ERR, "led: max_brightness: Failed to open %s: %s", buf, strerror(errno));
6363
return MRAA_ERROR_INVALID_RESOURCE;
6464
}
6565

@@ -119,7 +119,7 @@ mraa_led_init_internal(const char* led)
119119

120120
snprintf(brightness_path, sizeof(brightness_path), "%s/%s", led_path, "brightness");
121121
if (access(brightness_path, R_OK | W_OK) != 0) {
122-
syslog(LOG_NOTICE, "led: init: current user doesn't have access rights for using LED %s", led_name);
122+
syslog(LOG_NOTICE, "led: init: current user doesn't have access rights for %s", brightness_path);
123123
}
124124

125125
closedir(dir);

0 commit comments

Comments
 (0)