Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/version: ignore signals intended for the child process
Since the underlying toolchain is run as a child process (and not exec'd), signals that are sent to this process (for example, an interrupt sent by a shell) will be handled by both the parent and the child. This poses a problem for signals like SIGQUIT, where both processes' runtimes attempt to write out information to the same output. Before running the final command, start a signal handler that will ignore a signal sent to the parent, emulating the behavior of go run. This code is a modified version of cmd/go/internal/base. Fixes golang/go#36976. Change-Id: I29aa699dc059fd448aa9478f729ed8d90379616b Reviewed-on: https://go-review.googlesource.com/c/dl/+/217765 Trust: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Dmitri Shuralyov <dmitshur@golang.org> Trust: Filippo Valsorda <filippo@golang.org> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
- Loading branch information