Skip to content

Commit 6336eaa

Browse files
authored
Merge pull request #331 from kzys/fix-exit-code
Fix exitCode()
2 parents 7dbee2d + 470a211 commit 6336eaa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/service_integ_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,9 @@ func TestUpdateVMMetadata_Isolated(t *testing.T) {
11071107

11081108
func exitCode(err *exec.ExitError) int {
11091109
if status, ok := err.Sys().(syscall.WaitStatus); ok {
1110-
return int(status)
1110+
// As like Go 1.12's ExitStatus and WEXITSTATUS()
1111+
// https://github.com/golang/go/blob/3bea90d84107889aaaaa0089f615d7070951a832/src/syscall/syscall_linux.go#L301
1112+
return (int(status) & 0xff00) >> 8
11111113
}
11121114
return -1
11131115
}

0 commit comments

Comments
 (0)