aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-02-19 05:29:51 -0500
committerRuss Cox <rsc@golang.org>2021-02-19 15:30:59 +0000
commit01eb70e3dd4d7bf00ee915841e6b3c56fc94fe44 (patch)
tree318e60241c7391d425bda7accab22e228c3cddd7 /src/os
parent49add6ad90c3c6e150266b35ae98067d7b52c021 (diff)
downloadgo-01eb70e3dd4d7bf00ee915841e6b3c56fc94fe44.tar.gz
go-01eb70e3dd4d7bf00ee915841e6b3c56fc94fe44.zip
os: fix hex exit code print on 32-bit windows
We want to print hex exit codes for the large values, but on 32-bit Windows the large values are negative. Change-Id: I0e350b128414a9468c93eddc62d660f552c1ee05 Reviewed-on: https://go-review.googlesource.com/c/go/+/294070 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/os')
-rw-r--r--src/os/exec_posix.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os/exec_posix.go b/src/os/exec_posix.go
index 39f11c7ec1..8aa1e5e499 100644
--- a/src/os/exec_posix.go
+++ b/src/os/exec_posix.go
@@ -103,7 +103,7 @@ func (p *ProcessState) String() string {
switch {
case status.Exited():
code := status.ExitStatus()
- if runtime.GOOS == "windows" && code >= 1<<16 { // windows uses large hex numbers
+ if runtime.GOOS == "windows" && uint(code) >= 1<<16 { // windows uses large hex numbers
res = "exit status " + uitox(uint(code))
} else { // unix systems use small decimal integers
res = "exit status " + itoa(code) // unix