mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
respect goto restrictions
R=gri CC=golang-dev https://golang.org/cl/4625044
This commit is contained in:
parent
8155ff5452
commit
21e75da486
17 changed files with 110 additions and 94 deletions
|
|
@ -337,13 +337,7 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) {
|
|||
// Kick off child.
|
||||
pid, err = forkAndExecInChild(argv0p, argvp, envvp, chroot, dir, attr, sys, p[1])
|
||||
if err != 0 {
|
||||
error:
|
||||
if p[0] >= 0 {
|
||||
Close(p[0])
|
||||
Close(p[1])
|
||||
}
|
||||
ForkLock.Unlock()
|
||||
return 0, err
|
||||
goto error
|
||||
}
|
||||
ForkLock.Unlock()
|
||||
|
||||
|
|
@ -370,6 +364,14 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err int) {
|
|||
|
||||
// Read got EOF, so pipe closed on exec, so exec succeeded.
|
||||
return pid, 0
|
||||
|
||||
error:
|
||||
if p[0] >= 0 {
|
||||
Close(p[0])
|
||||
Close(p[1])
|
||||
}
|
||||
ForkLock.Unlock()
|
||||
return 0, err
|
||||
}
|
||||
|
||||
// Combination of fork and exec, careful to be thread safe.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue