Skip to content

Instantly share code, notes, and snippets.

@thomasphorton
Created November 6, 2015 09:04
Show Gist options
  • Save thomasphorton/c17dc3bff6ff08348799 to your computer and use it in GitHub Desktop.
Save thomasphorton/c17dc3bff6ff08348799 to your computer and use it in GitHub Desktop.
quick2wire-gpio-admin diff
diff --git a/src/gpio-admin.c b/src/gpio-admin.c
index 38569bb..faea863 100644
--- a/src/gpio-admin.c
+++ b/src/gpio-admin.c
@@ -27,7 +27,7 @@ static void usage_error(char **argv) {
static void allow_access_by_user(unsigned int pin, const char *filename) {
char path[PATH_MAX];
- int size = snprintf(path, PATH_MAX, "/sys/devices/virtual/gpio/gpio%u/%s", pin, filename);
+ int size = snprintf(path, PATH_MAX, "/sys/class/gpio/gpio%u/%s", pin, filename);
if (size >= PATH_MAX) {
error(7, 0, "path of GPIO pin is too long!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment