mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-24 15:48:18 +03:00
19 lines
349 B
Go
19 lines
349 B
Go
//go:build darwin || freebsd || linux || openbsd
|
|
|
|
package aghnet
|
|
|
|
import (
|
|
"io"
|
|
"syscall"
|
|
|
|
"github.com/AdguardTeam/golibs/errors"
|
|
)
|
|
|
|
// closePortChecker closes c. c must be non-nil.
|
|
func closePortChecker(c io.Closer) (err error) {
|
|
return c.Close()
|
|
}
|
|
|
|
func isAddrInUse(err syscall.Errno) (ok bool) {
|
|
return errors.Is(err, syscall.EADDRINUSE)
|
|
}
|