diff --git a/configure b/configure index 58b7e83..f537ada 100755 --- a/configure +++ b/configure @@ -117,7 +117,7 @@ function detect_rpi_revision { function detect_machine { local cpu=$(eval "uname -m 2>/dev/null") - local machine=$(eval "cat /sys/firmware/devicetree/base/model |tr -d '\0' 2>/dev/null") + local machine=$(eval "cat /sys/firmware/devicetree/base/model 2>/dev/null |tr -d '\0'") local hardware=$(eval "grep sunxi_platform /sys/class/sunxi_info/sys_info 2>/dev/null | sed 's/^.*: \(.*\)$/\1/'") if [ -z "$hardware" ]; then local hardware=$(eval "grep Hardware /proc/cpuinfo 2>/dev/null | sed 's/^.*: \(.*\)$/\1/'") diff --git a/drivers/Linux/interrupt.cpp b/drivers/Linux/interrupt.cpp index 6730c7f..e85f242 100644 --- a/drivers/Linux/interrupt.cpp +++ b/drivers/Linux/interrupt.cpp @@ -92,7 +92,7 @@ void *interruptHandler(void *args) // Setup poll structure polls.fd = fd; - polls.events = POLLPRI; + polls.events = POLLPRI | POLLERR; while (1) { // Wait for it ... @@ -103,12 +103,11 @@ void *interruptHandler(void *args) } // Do a dummy read to clear the interrupt // A one character read appars to be enough. - // Followed by a seek to reset it. - if (read (fd, &c, 1) < 0) { + if (lseek (fd, 0, SEEK_SET) < 0) { logError("Interrupt handler error: %s\n", strerror(errno)); break; } - if (lseek (fd, 0, SEEK_SET) < 0) { + if (read (fd, &c, 1) < 0) { logError("Interrupt handler error: %s\n", strerror(errno)); break; }