internal/gamepad: ignore EPERM when opening gamepads (#2308)

This seems required for the Snap sandbox when probing a non-gamepad device node.

Closes #2307
This commit is contained in:
divVerent 2022-09-06 08:29:32 -04:00 committed by Hajime Hoshi
parent 557bef998d
commit 0ae4002750

View File

@ -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