]> Cypherpunks repositories - gostls13.git/commitdiff
net: remove another unguarded sysfile == nil check
authorDave Cheney <dave@cheney.net>
Wed, 21 Nov 2012 04:04:22 +0000 (15:04 +1100)
committerDave Cheney <dave@cheney.net>
Wed, 21 Nov 2012 04:04:22 +0000 (15:04 +1100)
Putting aside the unguarded access to fd.sysfile, the condition will never be true as fd.incref above handles the closed condition.

R=mikioh.mikioh, dvyukov
CC=golang-dev
https://golang.org/cl/6845062

src/pkg/net/fd_unix.go

index 096ad41bbfad340f7f4ffe8572ab3e8913eb4aaa..d87c51ec6631796df1a5ec5dd37b4df39bdc8445 100644 (file)
@@ -509,10 +509,6 @@ func (fd *netFD) Write(p []byte) (int, error) {
                return 0, err
        }
        defer fd.decref()
-       if fd.sysfile == nil {
-               return 0, syscall.EINVAL
-       }
-
        var err error
        nn := 0
        for {