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 6, 2022
1 parent 62127e4 commit 551101a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/gamepad/gamepad_linux.go
Expand Up @@ -108,6 +108,10 @@ func (*nativeGamepadsImpl) openGamepad(gamepads *gamepads, path string) (err err
if err == unix.EACCES {
return nil
}
// This happens with the Snap sandbox.
if err == unix.EPERM {
return nil
}
// This happens just after a disconnection.
if err == unix.ENOENT {
return nil
Expand Down

0 comments on commit 551101a

Please sign in to comment.