Skip to contentSkip to conversation

keytable: open lirc for read/write for attaching/detaching bpf programs

PATCH New Sean Young 1 participant 1 message Apr 14, 2023 Media (V4L/DVB)

lore
Share & tools
lore

Sean Young

author
#0 lore raw

PATCH 1/1 keytable: open lirc for read/write for attaching/detaching bpf programs

---
 utils/keytable/keytable.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
utils/keytable/keytable.c +2 -2
index c47211fa..3d5a3c51 100644
@@ -1752,7 +1752,7 @@ static bool attach_bpf(const char *lirc_name, const char *bpf_prog, struct proto
 	struct rlimit rl;
 	int fd, ret;
 
-	fd = open(lirc_name, O_RDONLY);
+	fd = open(lirc_name, O_RDWR);
 	if (fd == -1) {
 		perror(lirc_name);
 		return false;
@@ -1843,7 +1843,7 @@ static void clear_bpf(const char *lirc_name)
 	unsigned int features, i;
 	int ret, prog_fd, fd;
 
-	fd = open(lirc_name, O_RDONLY);
+	fd = open(lirc_name, O_RDWR);
 	if (fd == -1) {
 		perror(lirc_name);
 		return;
Signature · 1 line
2.39.2