commit ea24195f556148d8e53f951c50c8d566c1533fcf parent 2b9c815ae133ec12c5c510d4b3afd6bf5696caf7 Author: Drew DeVault <sir@cmpwn.com> Date: Sun, 7 Feb 2021 15:14:06 -0500 os::exec::start: call finish on started command Diffstat:
M | os/exec/cmd.ha | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/os/exec/cmd.ha b/os/exec/cmd.ha @@ -65,10 +65,13 @@ export fn finish(cmd: *command) void = { // running process with the new command. export fn exec(cmd: *command) os_error = platform_exec(cmd); -// Starts a prepared command in a new process. +// Starts a prepared command in a new process and calls [finish] on the command. // // TODO: Return a handle which gives information about the new process. -export fn start(cmd: *command) (os_error | void) = platform_start(cmd); +export fn start(cmd: *command) (os_error | void) = { + defer finish(cmd); + platform_start(cmd); +}; fn lookup(name: str) (platform | void) = { const path = match (os::getenv("PATH")) {