From 6a296779c1d5a6b8fed8c6e4f40639ac3ec82e12 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 24 Sep 2012 09:16:40 +0100 Subject: [PATCH] reverting atempted bug fix as caused other things to fail awaiting feedback from anyone seen this seg fault before attempting blind fix --- Makefile | 4 ++-- src/input.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1f7ed02..eb167b4 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,9 @@ # rpi - uses xwindows to provide event handling # rpi_noX - get keyboard events from raw input, xwindows not needed -#PLATFORM=xorg +PLATFORM=xorg #PLATFORM=rpi -PLATFORM=rpi_noX +#PLATFORM=rpi_noX #### diff --git a/src/input.c b/src/input.c index c6bcf4b..1010e29 100644 --- a/src/input.c +++ b/src/input.c @@ -246,7 +246,7 @@ bool *getKeys() int n; n = scandir ("/dev/input/by-path/", &eps, __dfilter, __dsort); - if (n > 0) + if (n >= 0) { // only check 1st usb keyboard.... char fn[256]; @@ -276,7 +276,7 @@ bool *getKeys() if (ioctl(__key_fd, KDGKBMODE, &old_keyboard_mode) < 0) { //return 0; printf("couldn't get the keyboard, are you running via ssh\n"); - printf("without setting evdev permissions? \n"); + printf("or without setting evdev permissions? \n"); } tcgetattr(__key_fd, &tty_attr_old);