Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(334)

Unified Diff: src/pkg/syscall/syscall_solaris.go

Issue 69910043: code review 69910043: syscall: make address of unnamed Unix sockets empty on ...
Patch Set: diff -r f62cd90ce0d8 https://go.googlecode.com/hg/ Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/pkg/syscall/syscall_solaris.go
===================================================================
--- a/src/pkg/syscall/syscall_solaris.go
+++ b/src/pkg/syscall/syscall_solaris.go
@@ -142,7 +142,7 @@
if err = getsockname(fd, &rsa, &len); err != nil {
return
}
- return anyToSockaddr(&rsa)
+ return anyToSockaddr(&rsa, len)
}
func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
@@ -312,7 +312,7 @@
return nil
}
-func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) {
+func anyToSockaddr(rsa *RawSockaddrAny, _ _Socklen) (Sockaddr, error) {
switch rsa.Addr.Family {
case AF_UNIX:
pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa))
@@ -362,7 +362,7 @@
if err != nil {
return
}
- sa, err = anyToSockaddr(&rsa)
+ sa, err = anyToSockaddr(&rsa, len)
if err != nil {
Close(nfd)
nfd = 0
@@ -397,7 +397,7 @@
oobn = int(msg.Accrightslen)
// source address is only specified if the socket is unconnected
if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(&rsa)
+ from, err = anyToSockaddr(&rsa, SizeofSockaddrAny)
}
return
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b