termio/exec: detect exec failure and show an error message

This commit is contained in:
Mitchell Hashimoto
2023-12-30 15:04:06 -08:00
parent 8c5e8c504e
commit 2ed75d47b5
2 changed files with 39 additions and 1 deletions

View File

@@ -155,6 +155,11 @@ fn startPosix(self: *Command, arena: Allocator) !void {
// Finally, replace our process.
_ = std.os.execveZ(pathZ, argsZ, envp) catch null;
// If we are executing this code, the exec failed. In that scenario,
// we return a very specific error that can be detected to determine
// we're in the child.
return error.ExecFailedInChild;
}
fn startWindows(self: *Command, arena: Allocator) !void {