Reader: Move the "print exit code in a file" hack to the PB

implementation, where this mess belongs.

No other platform relies on this (because, spoiler alert, InkView \o/).
reviewable/pr10821/r1
NiLuJe 9 months ago
parent 4acf131071
commit e9a84ca434

@ -256,6 +256,21 @@ function PocketBook:init()
Generic.init(self)
end
function PocketBook:exit()
Generic.exit(self)
-- Exit code can be shoddy on some devices due to broken library dtors calling _exit(0) from os.exit(N)
local ko_exit = os.getenv("KO_EXIT_CODE")
if ko_exit then
local fo = io.open(ko_exit, "w+")
if fo then
-- As returned by UIManager:run() in reader.lua
fo:write(tostring(UIManager._exit_code))
fo:close()
end
end
end
function PocketBook:notifyBookState(title, document)
local fn = document and document.file
logger.dbg("Notify book state", title, fn)

@ -324,16 +324,6 @@ end
-- Exit
local function exitReader()
-- Exit code can be shoddy on some platforms due to broken library dtors calling _exit(0) from os.exit(N)
local ko_exit = os.getenv("KO_EXIT_CODE")
if ko_exit then
local fo = io.open(ko_exit, "w+")
if fo then
fo:write(tostring(exit_code))
fo:close()
end
end
-- Save any device settings before closing G_reader_settings
Device:saveSettings()

Loading…
Cancel
Save