Handle input.close errors sanely

In cases the input backend already closed the fd, we still need to clear
our array
reviewable/pr11807/r4
NiLuJe 4 weeks ago
parent 31791ed80b
commit 2711133037

@ -332,8 +332,10 @@ function Input.close(path)
-- Make sure we actually know about this device
local fd = Input.opened_devices[path]
if fd then
input.close(fd)
Input.opened_devices[path] = nil
local ok, err = input.close(fd)
if ok or err == C.ENODEV then
Input.opened_devices[path] = nil
end
else
logger.warn("Tried to close an unknown input device @", path)
end

Loading…
Cancel
Save