diff options
Diffstat (limited to 'libgo/go/net/sockopt.go')
-rw-r--r-- | libgo/go/net/sockopt.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libgo/go/net/sockopt.go b/libgo/go/net/sockopt.go index 59f9af5..3d0f8dd 100644 --- a/libgo/go/net/sockopt.go +++ b/libgo/go/net/sockopt.go @@ -117,12 +117,20 @@ func setWriteBuffer(fd *netFD, bytes int) error { } func setReadDeadline(fd *netFD, t time.Time) error { - fd.rdeadline = t.UnixNano() + if t.IsZero() { + fd.rdeadline = 0 + } else { + fd.rdeadline = t.UnixNano() + } return nil } func setWriteDeadline(fd *netFD, t time.Time) error { - fd.wdeadline = t.UnixNano() + if t.IsZero() { + fd.wdeadline = 0 + } else { + fd.wdeadline = t.UnixNano() + } return nil } |