Aaron Klotz 4bb03609bc tool/gocross: ensure child process error codes are propagated on non-Unix
The Unix implementation of doExec propagates error codes by virtue of
the fact that it does an execve; the replacement binary will return the
exit code.

On non-Unix, we need to simulate these semantics by checking for an
ExitError and, when present, passing that value on to os.Exit.

We also add error handling to the doExec call for the benefit of
handling any errors where doExec fails before being able to execute
the desired binary.

Updates https://github.com/tailscale/corp/issues/29940

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2025-09-15 12:33:26 -07:00
..
2023-10-30 18:20:33 +00:00
2023-10-30 18:20:33 +00:00
2022-07-22 11:36:49 -07:00