From 53260943eac49dde51e0ce28e50e9b4bc90661b8 Mon Sep 17 00:00:00 2001 From: Forest Johnson Date: Fri, 8 Oct 2021 19:03:35 +0000 Subject: [PATCH] os: explain ProccessState.Exited() SIGKILL interaction When a process is forcefully killed (for example, with SIGKILL on unix), its ProccessState.Exited() will return false. Change-Id: I8cebc8d28f2ba1b687c145f6d941647fc3a10665 GitHub-Last-Rev: 414ae1980fe61dd530c46cc2c7f4de3a5bc83ed5 GitHub-Pull-Request: golang/go#48871 Reviewed-on: https://go-review.googlesource.com/c/go/+/354698 Reviewed-by: Ian Lance Taylor Trust: Alexander Rakoczy Run-TryBot: Alexander Rakoczy TryBot-Result: Go Bot --- src/os/exec.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/exec.go b/src/os/exec.go index bc75d4dd66..2beac55f89 100644 --- a/src/os/exec.go +++ b/src/os/exec.go @@ -149,6 +149,8 @@ func (p *ProcessState) SystemTime() time.Duration { } // Exited reports whether the program has exited. +// On Unix systems this reports true if the program exited due to calling exit, +// but false if the program terminated due to a signal. func (p *ProcessState) Exited() bool { return p.exited() } -- 2.50.0