From c6d2a0358f221be41450503b45a4f14db14bf690 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Fri, 16 Oct 2020 14:11:51 -0400 Subject: hosted: open input device as read-only. Change-Id: I4dcd98f45f41fe06a0a75a2a0dd45c753c2cf365 --- firmware/target/hosted/xduoo/button-xduoo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/target/hosted/xduoo/button-xduoo.c') diff --git a/firmware/target/hosted/xduoo/button-xduoo.c b/firmware/target/hosted/xduoo/button-xduoo.c index 3dc1bdc13a..67cb9a6c46 100644 --- a/firmware/target/hosted/xduoo/button-xduoo.c +++ b/firmware/target/hosted/xduoo/button-xduoo.c @@ -76,7 +76,7 @@ static int button_map(int keycode) void button_init_device(void) { - const char * const input_devs[] = { + const char * const input_devs[NR_POLL_DESC] = { "/dev/input/event0", "/dev/input/event1", "/dev/input/event2" @@ -84,7 +84,7 @@ void button_init_device(void) for(int i = 0; i < NR_POLL_DESC; i++) { - int fd = open(input_devs[i], O_RDWR | O_CLOEXEC); + int fd = open(input_devs[i], O_RDONLY | O_CLOEXEC); if(fd < 0) { -- cgit v1.2.3