From 4c129c083bd74dcd3192582551e168cde02e7914 Mon Sep 17 00:00:00 2001 From: Robert Obryk Date: Sat, 26 Apr 2014 19:59:00 -0700 Subject: [PATCH] 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 --- src/pkg/net/fd_unix.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pkg/net/fd_unix.go b/src/pkg/net/fd_unix.go index 5ed0d3ac5a..b82ecd11c1 100644 --- a/src/pkg/net/fd_unix.go +++ b/src/pkg/net/fd_unix.go @@ -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} }