Skip to content

Commit

Permalink
internal/gamepad: ignore EPERM when opening gamepads (#2308)
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.

Closes #2307
  • Loading branch information
divVerent authored and hajimehoshi committed Sep 6, 2022
1 parent 557bef9 commit 0ae4002
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 0ae4002

Please sign in to comment.