evdev: open input devices read-only

go-evdev default is O_RDWR but we dont need to open evdev devices RW

(cherry picked from commit 6e9a657132)
This commit is contained in:
bbedward committed 2026-09-15 16:46:47 -04:00
1 parent 69955286a7
commit e73b9c3ce1
1 file changed
+2 -2
+2 -2
View File
@@ -126,7 +126,7 @@ func findKeyboards() ([]EvdevDevice, error) {
var keyboards []EvdevDevice
for _, path := range matches {
device, err := evdev.Open(path)
device, err := evdev.OpenWithFlags(path, os.O_RDONLY)
if err != nil {
continue
}
@@ -207,7 +207,7 @@ func (m *Manager) watchForNewKeyboards() {
continue
}
device, err := evdev.Open(event.Name)
device, err := evdev.OpenWithFlags(event.Name, os.O_RDONLY)
if err != nil {
m.devicesMutex.Unlock()
continue