fix subprocesses not having access to load/loadfile or kitn apis

main
cinder 6 months ago
parent a18266c96f
commit b046f8b4b5

@ -157,11 +157,12 @@ function fillEnv(proc, uenv)
function ukitn.createProcess(path, ...)
checkArg(1, path, 'string')
local env = mirror(envBase)
local env = {}
local fn, err = uloadfile(path, nil, env)
if not fn then return nil, err end
local newProc = co_create(fn)
fillEnv(newProc, env)
processes[newProc] = { env = env, parent = proc, path = path }
runnable[newProc] = pack(...)
return newProc

Loading…
Cancel
Save