mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
I/O: Improve messaging when user doesn't have permissions to write to LEDs
This is e.g. the case with the newly released Raspbian 2015-09-24.
This commit is contained in:
@@ -87,7 +87,10 @@ public class LED {
|
||||
String fn = "/sys/class/leds/" + dev + "/trigger";
|
||||
int ret = NativeInterface.writeFile(fn, "none");
|
||||
if (ret < 0) {
|
||||
throw new RuntimeException(fn + ": " + NativeInterface.getError(ret));
|
||||
if (ret == -13) { // EACCES
|
||||
System.err.println("You might need to install a custom udev rule to allow regular users to modify /sys/class/leds/*.");
|
||||
}
|
||||
throw new RuntimeException(NativeInterface.getError(ret));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user