Skip to content

Commit

Permalink
jsc/wasm32/wasm32.jsc: perl fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pipcet committed Feb 1, 2021
1 parent 231ec12 commit 140e2d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jsc/wasm32/wasm32.jsc
Original file line number Diff line number Diff line change
Expand Up @@ -1707,9 +1707,12 @@ Wasm32Kernel.prototype.message = function (port, data)
if (this.ports_by_pid[ppid]) {
this.ports_by_pid[ppid].postMessage(["response", this.wait4[ppid], [pid, exitcode]]);
}
let thread = this.threads_by_port.get(this.ports_by_pid[ppid]);
thread.system.runqueue.push(thread);
} else if (data[0] === "wait4") {
var pid = this.pids_by_port.get(port);
this.wait4[pid] = seq;
this.ports_by_pid[pid].postMessage(["response", this.wait4[pid], [data[1], 0]]);
} else {
console.log(data);
throw "unknown message!";
Expand Down Expand Up @@ -5135,8 +5138,9 @@ if (typeof(os) !== "undefined" &&
fd.readPosition = pos;
else if (whence == %{SEEK_CUR})
fd.readPosition += pos;
/*
else if (whence == %{SEEK_END})
throw("SEEK_END not supported");
throw("SEEK_END not supported"); */
else
return -%{EINVAL};

Expand Down Expand Up @@ -5238,8 +5242,7 @@ if (typeof(os) !== "undefined" &&
let o = os.waitpid(pid);
let output = os.file.readFile("/tmp/tmp.out." + timestamp, "binary");
let ret = this.fds[1].write(output, 0, output.length);
this.kport.req("exit", [0]);
return new Promise(() => {});
return this.kport.req("exit", [0]);
} catch (e) {
console.log("OH NO!");
console.log(e);
Expand Down

0 comments on commit 140e2d5

Please sign in to comment.