Skip to content

Commit

Permalink
Also ignore EPERM when opening gamepads.
Browse files Browse the repository at this point in the history
This seems required for the snap sandbox when probing a non-gamepad device node.

Fixes #2307.
  • Loading branch information
divVerent committed Sep 5, 2022
1 parent 62127e4 commit 2a34808
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/gamepad/gamepad_linux.go
Expand Up @@ -105,7 +105,7 @@ func (*nativeGamepadsImpl) openGamepad(gamepads *gamepads, path string) (err err

fd, err := unix.Open(path, unix.O_RDONLY|unix.O_NONBLOCK, 0)
if err != nil {
if err == unix.EACCES {
if err == unix.EACCES || err == unix.EPERM {
return nil
}
// This happens just after a disconnection.
Expand Down

0 comments on commit 2a34808

Please sign in to comment.