summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/agptek/button-agptek.c
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/button-agptek.c
parent1a76bc403e647ac40f2218dd3808ce8b3f9a80d9 (diff)
downloadrockbox-c6d2a0358f221be41450503b45a4f14db14bf690.tar.gz
rockbox-c6d2a0358f221be41450503b45a4f14db14bf690.zip
hosted: open input device as read-only.
Change-Id: I4dcd98f45f41fe06a0a75a2a0dd45c753c2cf365
Diffstat (limited to 'firmware/target/hosted/agptek/button-agptek.c')
-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)
70 70
71void button_init_device(void) 71void button_init_device(void)
72{ 72{
73 const char * const input_devs[] = { 73 const char * const input_devs[NR_POLL_DESC] = {
74 "/dev/input/event0", 74 "/dev/input/event0",
75 "/dev/input/event1" 75 "/dev/input/event1"
76 }; 76 };
77 77
78 for(int i = 0; i < NR_POLL_DESC; i++) 78 for(int i = 0; i < NR_POLL_DESC; i++)
79 { 79 {
80 int fd = open(input_devs[i], O_RDWR | O_CLOEXEC); 80 int fd = open(input_devs[i], O_RDONLY | O_CLOEXEC);
81 81
82 if(fd < 0) 82 if(fd < 0)
83 { 83 {
@@ -146,4 +146,3 @@ void button_close_device(void)
146 close(poll_fds[i].fd); 146 close(poll_fds[i].fd);
147 } 147 }
148} 148}
149