From bd86d9c8b8238839a206b024e1c8bed75fb65b0b Mon Sep 17 00:00:00 2001 From: wangyanjiong Date: Thu, 8 Nov 2018 07:50:42 -0600 Subject: [PATCH] apps/examples/gpio: Align with gpio driver update --- examples/gpio/gpio_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/gpio/gpio_main.c b/examples/gpio/gpio_main.c index 54e512674..ded5d3989 100644 --- a/examples/gpio/gpio_main.c +++ b/examples/gpio/gpio_main.c @@ -249,17 +249,23 @@ int gpio_main(int argc, char *argv[]) if (havesigno) { + struct sigevent notify; struct timespec ts; sigset_t set; + notify.sigev_notify = SIGEV_SIGNAL; + notify.sigev_signo = signo; + /* Set up to receive signal */ - ret = ioctl(fd, GPIOC_REGISTER, (unsigned long)signo); + ret = ioctl(fd, GPIOC_REGISTER, (unsigned long)¬ify); if (ret < 0) { int errcode = errno; + fprintf(stderr, "ERROR: Failed to setup for signal from %s: %d\n", devpath, errcode); + close(fd); return EXIT_FAILURE; }