From 0150b024789f6b7356a738334d3b325a50297452 Mon Sep 17 00:00:00 2001 From: Gordon Henderson Date: Fri, 27 Jun 2014 10:55:39 +0100 Subject: [PATCH] Fixed a small bug in the ISR code where it was looking for the gpio program. Should now work correctly on Arch, or other systems that install gpio as /usr/bin/gpio. --- gpio/gpio.c | 2 +- wiringPi/wiringPi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gpio/gpio.c b/gpio/gpio.c index b2f9953..b9d1799 100644 --- a/gpio/gpio.c +++ b/gpio/gpio.c @@ -55,7 +55,7 @@ extern void doPins (void) ; # define FALSE (1==2) #endif -#define VERSION "2.15" +#define VERSION "2.16" #define I2CDETECT "/usr/sbin/i2cdetect" int wpMode ; diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index 63a8946..f0e8282 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -1472,12 +1472,12 @@ int wiringPiISR (int pin, int mode, void (*function)(void)) if (pid == 0) // Child, exec { - if (access ("/usr/local/bin/gpio", X_OK)) + /**/ if (access ("/usr/local/bin/gpio", X_OK) == 0) { execl ("/usr/local/bin/gpio", "gpio", "edge", pinS, modeS, (char *)NULL) ; return wiringPiFailure (WPI_FATAL, "wiringPiISR: execl failed: %s\n", strerror (errno)) ; } - else if (access ("/usr/bin/gpio", X_OK)) + else if (access ("/usr/bin/gpio", X_OK) == 0) { execl ("/usr/bin/gpio", "gpio", "edge", pinS, modeS, (char *)NULL) ; return wiringPiFailure (WPI_FATAL, "wiringPiISR: execl failed: %s\n", strerror (errno)) ; -- 2.30.2