1
0
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:
20kdc 2018-04-25 19:54:37 +01:00
parent bed9f55d70
commit 5ddfb128cd

View File

@ -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