mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
49add6ad90
commit
01eb70e3dd
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue