Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Delta Between Two Patch Sets: src/pkg/os/exec_posix.go

Issue 4628045: code review 4628045: os: Change Waitmsg.String() to operate on pointer.
Left Patch Set: diff -r dc6d3cf9279d https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Right Patch Set: diff -r 37a78ff6db53 https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/os/exec_plan9.go ('k') | src/pkg/os/os_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package os 5 package os
6 6
7 import ( 7 import (
8 "runtime" 8 "runtime"
9 "syscall" 9 "syscall"
10 ) 10 )
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 if i < 0 { 123 if i < 0 {
124 bp-- 124 bp--
125 b[bp] = '-' 125 b[bp] = '-'
126 } 126 }
127 127
128 return string(b[bp:]) 128 return string(b[bp:])
129 } 129 }
130 130
131 func (w *Waitmsg) String() string { 131 func (w *Waitmsg) String() string {
132 if w == nil {
133 return "<nil>"
134 }
132 // TODO(austin) Use signal names when possible? 135 // TODO(austin) Use signal names when possible?
133 res := "" 136 res := ""
134 switch { 137 switch {
135 case w.Exited(): 138 case w.Exited():
136 res = "exit status " + itod(w.ExitStatus()) 139 res = "exit status " + itod(w.ExitStatus())
137 case w.Signaled(): 140 case w.Signaled():
138 res = "signal " + itod(w.Signal()) 141 res = "signal " + itod(w.Signal())
139 case w.Stopped(): 142 case w.Stopped():
140 res = "stop signal " + itod(w.StopSignal()) 143 res = "stop signal " + itod(w.StopSignal())
141 if w.StopSignal() == syscall.SIGTRAP && w.TrapCause() != 0 { 144 if w.StopSignal() == syscall.SIGTRAP && w.TrapCause() != 0 {
142 res += " (trap " + itod(w.TrapCause()) + ")" 145 res += " (trap " + itod(w.TrapCause()) + ")"
143 } 146 }
144 case w.Continued(): 147 case w.Continued():
145 res = "continued" 148 res = "continued"
146 } 149 }
147 if w.CoreDump() { 150 if w.CoreDump() {
148 res += " (core dumped)" 151 res += " (core dumped)"
149 } 152 }
150 return res 153 return res
151 } 154 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b