MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / String

Method String

common/sandbox/cmd/exec_posix.go:107–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105}
106
107func (p *ProcessState) String() string {
108 if p == nil {
109 return "<nil>"
110 }
111 status := p.Sys().(syscall.WaitStatus)
112 res := ""
113 switch {
114 case status.Exited():
115 res = "exit status " + itoa(status.ExitStatus())
116 case status.Signaled():
117 res = "signal: " + status.Signal().String()
118 case status.Stopped():
119 res = "stop signal: " + status.StopSignal().String()
120 if status.StopSignal() == syscall.SIGTRAP && status.TrapCause() != 0 {
121 res += " (trap " + itoa(status.TrapCause()) + ")"
122 }
123 case status.Continued():
124 res = "continued"
125 }
126 if status.CoreDump() {
127 res += " (core dumped)"
128 }
129 return res
130}
131
132// ExitCode returns the exit code of the exited process, or -1
133// if the process hasn't exited or was terminated by a signal.

Callers

nothing calls this directly

Calls 5

SysMethod · 0.95
ExitedMethod · 0.80
itoaFunction · 0.70
StringMethod · 0.65
SignalMethod · 0.65

Tested by

no test coverage detected