Wrap closeAll to clear the fd hashmap

reviewable/pr11807/r4
NiLuJe 3 weeks ago
parent 1b4380ca3a
commit f99f862832

@ -569,7 +569,7 @@ function Device:exit()
G_reader_settings:close()
-- I/O teardown
require("ffi/input"):closeAll()
self.input.teardown()
end
-- Lifted from busybox's libbb/inet_cksum.c

@ -300,7 +300,7 @@ function Input:disableRotationMap()
end
--[[--
Wrapper for Lua/C input open.
Wrapper for our Lua/C input module's open.
Note that we adhere to the "." syntax here for compatibility.
@ -325,7 +325,7 @@ function Input.open(path, name)
end
--[[--
Wrapper for Lua/C input close.
Wrapper for our Lua/C input module's close.
Note that we adhere to the "." syntax here for compatibility.
--]]
@ -340,6 +340,16 @@ function Input.close(path)
end
end
--[[--
Wrapper for our Lua/C input module's closeAll.
Note that we adhere to the "." syntax here for compatibility.
--]]
function Input.teardown()
input.closeAll()
Input.opened_devices = {}
end
--[[--
Different device models can implement their own hooks and register them.
--]]

@ -141,6 +141,7 @@ local Kobo = Generic:extend{
battery_sysfs = "/sys/class/power_supply/mc13892_bat",
-- Stable path to the NTX input device
ntx_dev = "/dev/input/event0",
ntx_fd = nil,
-- Stable path to the Touch input device
touch_dev = "/dev/input/event1",
-- Event code to use to detect contact pressure

Loading…
Cancel
Save