summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/fiio/button-fiio.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/fiio/button-fiio.c
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/fiio/button-fiio.c')
-rw-r--r--firmware/target/hosted/fiio/button-fiio.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/target/hosted/fiio/button-fiio.c b/firmware/target/hosted/fiio/button-fiio.c
index 79ed702668..134ec5a426 100644
--- a/firmware/target/hosted/fiio/button-fiio.c
+++ b/firmware/target/hosted/fiio/button-fiio.c
@@ -85,7 +85,7 @@ static int button_map_on(int keycode)
case KEY_F8:
key_power_delay = 0;
return BUTTON_POWER;
-
+
case KEY_HOME:
key_home_delay = DEF_DELAY;
return BUTTON_OPTION;
@@ -147,7 +147,7 @@ static int button_map_off(int keycode)
case KEY_F8:
return BUTTON_POWER;
-
+
case KEY_F9:
return BUTTON_OPTION;
@@ -168,7 +168,7 @@ static int button_map_off(int keycode)
static int button_map_timer(void)
{
int map = 0;
-
+
if (key_enter_delay)
{
if (--key_enter_delay == 0) map |= BUTTON_PLAY;
@@ -219,14 +219,14 @@ static int button_map_timer(void)
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)
{