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 GitHub
parent bb406c9b8f
commit 34a500c305
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,10 @@ func (*nativeGamepadsImpl) openGamepad(gamepads *gamepads, path string) (err err
if err == unix.EACCES { if err == unix.EACCES {
return nil return nil
} }
// This happens with the Snap sandbox.
if err == unix.EPERM {
return nil
}
// This happens just after a disconnection. // This happens just after a disconnection.
if err == unix.ENOENT { if err == unix.ENOENT {
return nil return nil