mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-11-23 10:58:06 +11:00
Actually actually actually fix service autostart
Bugfixing. Bugfixing never changes.
This commit is contained in:
parent
bed9f55d70
commit
5ddfb128cd
@ -276,9 +276,14 @@ rootAccess.securityPolicy = function (pid, proc, perm, req)
|
||||
end
|
||||
-- Prepare for success
|
||||
onReg[perm] = onReg[perm] or {}
|
||||
table.insert(onReg[perm], function ()
|
||||
finish()
|
||||
end)
|
||||
local orp = onReg[perm]
|
||||
local function kme()
|
||||
if finish then
|
||||
finish()
|
||||
finish = nil
|
||||
end
|
||||
end
|
||||
table.insert(orp, kme)
|
||||
pcall(neo.executeAsync, "svc-" .. appAct)
|
||||
-- Fallback "quit now"
|
||||
local time = os.uptime() + 30
|
||||
@ -287,7 +292,15 @@ rootAccess.securityPolicy = function (pid, proc, perm, req)
|
||||
function f()
|
||||
if finish then
|
||||
if os.uptime() >= time then
|
||||
finish()
|
||||
-- we've given up
|
||||
if onReg[perm] == orp then
|
||||
for k, v in ipairs(orp) do
|
||||
if v == kme then
|
||||
table.remove(orp, k)()
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
table.insert(todo, f)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user