]> Cypherpunks.ru repositories - gostls13.git/commit
syscall: clean up variable declarations in forkAndExecInChild
authorBryan C. Mills <bcmills@google.com>
Fri, 9 Dec 2022 17:30:24 +0000 (12:30 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 25 Jan 2023 03:23:11 +0000 (03:23 +0000)
commite216ee7e7416df48dc9550a6f18552a4ada5d419
treee0bd79351dd2a0e4dbdbd154120a42f1161bb8ce
parent01636cf3fd35787cf6df449414d5db00b3e89692
syscall: clean up variable declarations in forkAndExecInChild

The various forkAndExecInChild implementations have comments
explaining that they pre-declare variables to force allocations
to occur before forking, but then later use ":=" declarations
for additional variables.

To make it clearer that those ":=" declarations do not allocate,
we move their declarations up to the predeclared blocks.

For #57208.

Change-Id: Ie8cb577fa7180b51b64d6dc398169053fdf8ea97
Reviewed-on: https://go-review.googlesource.com/c/go/+/456516
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/syscall/exec_bsd.go
src/syscall/exec_freebsd.go
src/syscall/exec_libc.go
src/syscall/exec_libc2.go
src/syscall/exec_linux.go
src/syscall/exec_plan9.go