mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
unix: remove duplicate comment regarding sockaddr conversions
Change-Id: Ib916857732274ec4a7e425a9038b8435bccd5d9a Reviewed-on: https://go-review.googlesource.com/c/sys/+/248779 Run-TryBot: Matt Layher <mdlayher@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
@@ -576,15 +576,10 @@ func sockaddrL2TPIP6ToAny(in RawSockaddrL2TPIP6) *RawSockaddrAny {
|
||||
|
||||
func sockaddrUnixToAny(in RawSockaddrUnix) *RawSockaddrAny {
|
||||
var out RawSockaddrAny
|
||||
|
||||
// Explicitly copy the contents of in into out to produce the correct
|
||||
// sockaddr structure, without relying on unsafe casting to a type of a
|
||||
// larger size.
|
||||
copy(
|
||||
(*(*[SizeofSockaddrAny]byte)(unsafe.Pointer(&out)))[:],
|
||||
(*(*[SizeofSockaddrUnix]byte)(unsafe.Pointer(&in)))[:],
|
||||
)
|
||||
|
||||
return &out
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user