]> Cypherpunks repositories - gostls13.git/commit
runtime: initialize crashFD to -1
authorMichael Pratt <mpratt@google.com>
Fri, 2 Feb 2024 18:00:02 +0000 (13:00 -0500)
committerMichael Pratt <mpratt@google.com>
Fri, 2 Feb 2024 18:35:18 +0000 (18:35 +0000)
commit3d20a327a1f91ae912865aa13bc07cda9930fefc
tree8c3d651785b80ed643ef03d07ecb1e2536a0865e
parent6b0309ceb61e297907d127a46a8faffbc8429f06
runtime: initialize crashFD to -1

crashFD defaults to the zero value of (surprise!) zero. Zero is a valid
FD, so on the first call to SetCrashOutput we actually close FD 0 since
it is a "valid" FD.

Initialize crashFD to -1, the sentinel for "no FD".

Change-Id: I3b108c60603f2b83b867cbe079f035c159b6a6ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/560776
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/proc.go
src/runtime/runtime.go