some tweaks to exec and process manager

This commit is contained in:
Lisa Milne 2023-12-19 22:39:05 +10:00
parent 7071a63dfa
commit a93576a832

View file

@ -652,7 +652,7 @@ clite.proc = {
gpid:mapCPID(cpid), // the group pid (parent process id) of this process
pid:data.nextid++, // the pid (process id) of this process
ctty:0, // the id of the controlling tty for this process
func:fn, // the function this process executes
obj:fn, // the function this process executes
waits:[] // array of wait() calls pending for this process on exit
});
var parent = getProc(proc.gpid);
@ -669,13 +669,14 @@ clite.proc = {
n.data.content = 'pid: '+proc.pid+'\n';
return proc.pid;
}
clite.proc.update = function(pid,cl) {
clite.proc.update = function(pid,cl,obj) {
var proc = getProc(pid);
if (!proc)
return false;
var n = vfsapi.getNode(0,'/proc/'+proc.pid);
if (!n)
return false;
proc.obj = obj;
n.data.content += 'command: '+cl+'\n';
return true;
}
@ -3557,7 +3558,7 @@ clite.lib = {
return null;
}
clite.proc.update(io.pid,args.join(' '));
clite.proc.update(io.pid,args.join(' '),fd.node.data.content);
var r = clite.core.execSafe(function() {
var rr = fd.node.data.content(args,env,io);