]> Cypherpunks repositories - gostls13.git/commitdiff
net: Remove an unmatched unlock of ForkLock
authorRobert Obryk <robryk@gmail.com>
Sun, 27 Apr 2014 02:59:00 +0000 (19:59 -0700)
committerIan Lance Taylor <iant@golang.org>
Sun, 27 Apr 2014 02:59:00 +0000 (19:59 -0700)
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

src/pkg/net/fd_unix.go

index 5ed0d3ac5aab27676185e91589039f1a69518d02..b82ecd11c1abce64705833054fc18ecf4311a0e7 100644 (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}
        }