summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/agptek
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-16 14:11:51 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-16 14:37:01 -0400
commitc6d2a0358f221be41450503b45a4f14db14bf690 (patch)
tree80af5b360d9b54238a1247d93215d2a4f2c5a556 /firmware/target/hosted/agptek
parent1a76bc403e647ac40f2218dd3808ce8b3f9a80d9 (diff)
downloadrockbox-c6d2a0358f.tar.gz
rockbox-c6d2a0358f.tar.bz2
rockbox-c6d2a0358f.zip
hosted: open input device as read-only.
Change-Id: I4dcd98f45f41fe06a0a75a2a0dd45c753c2cf365
Diffstat (limited to 'firmware/target/hosted/agptek')
-rw-r--r--firmware/target/hosted/agptek/button-agptek.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/firmware/target/hosted/agptek/button-agptek.c b/firmware/target/hosted/agptek/button-agptek.c
index 83953e0dab..2c84a50405 100644
--- a/firmware/target/hosted/agptek/button-agptek.c
+++ b/firmware/target/hosted/agptek/button-agptek.c
@@ -70,14 +70,14 @@ 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"
};
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)
{
@@ -146,4 +146,3 @@ void button_close_device(void)
close(poll_fds[i].fd);
}
}
-