From 87cc360b88b7541d79963b32d2a302f184d10756 Mon Sep 17 00:00:00 2001 From: Gregory Elleouet Date: Mon, 4 May 2015 22:37:12 +0200 Subject: [PATCH] Update gpio-admin.c GPIO path in "allow_access_by_user" function doesn't correspond to new path "/sys/class/gpio/". With new kernel 3.18, it throw an error when export a pin. --- src/gpio-admin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpio-admin.c b/src/gpio-admin.c index 38569bb..a9c751c 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, "%sgpio%u/%s", GPIO_CLASS_PATH, pin, filename); if (size >= PATH_MAX) { error(7, 0, "path of GPIO pin is too long!");