1
0
mirror of https://github.com/golang/go synced 2024-09-25 09:20:18 -06:00

net: Remove an unmatched unlock of ForkLock

Remove an RUnlock of syscall.ForkLock with no matching RLock.
Holding ForkLock in netFD.dup is unnecessary: dupCloseOnExecOld
locks and unlocks the lock on its own and dupCloseOnExec doesn't
need the ForkLock to be held.

LGTM=iant
R=golang-codereviews, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/99800044
This commit is contained in:
Robert Obryk 2014-04-26 19:59:00 -07:00 committed by Ian Lance Taylor
parent 9d7b9fb7d0
commit 4c129c083b

View File

@ -482,7 +482,6 @@ func dupCloseOnExecOld(fd int) (newfd int, err error) {
func (fd *netFD) dup() (f *os.File, err error) {
ns, err := dupCloseOnExec(fd.sysfd)
if err != nil {
syscall.ForkLock.RUnlock()
return nil, &OpError{"dup", fd.net, fd.laddr, err}
}