mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
This change is sheer speculation based on the failures observed in golang/go#37319. (A deadlock in the test prevented us from seeing the actual failure mode of golang/go#51342 up until CL 387915, and it isn't obvious to me that we should wait for another failure before trying a likely — and otherwise harmless — fix.) This is a port of CL 376095 to the "ipv4" package. Fixes golang/go#51342. (Maybe.) Change-Id: Idd6d2d785dbb0c98404f99bd98a3c4ddc11cb2cf Reviewed-on: https://go-review.googlesource.com/c/net/+/387916 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
21 lines
549 B
Go
21 lines
549 B
Go
// Copyright 2022 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
|
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
|
|
package ipv4_test
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// isENOBUFS reports whether err is unix.ENOBUFS.
|
|
// (Always false on non-Unix platforms.)
|
|
func isENOBUFS(err error) bool {
|
|
return errors.Is(err, unix.ENOBUFS)
|
|
}
|