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

Side by Side Diff: src/pkg/syscall/route_darwin.go

Issue 5372080: code review 5372080: syscall: use error (Closed)
Patch Set: diff -r 25e37de63f5d https://go.googlecode.com/hg/ Created 13 years, 4 months ago
Left:
Right:
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 unified diff | Download patch
« no previous file with comments | « src/pkg/syscall/route_bsd.go ('k') | src/pkg/syscall/route_freebsd.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Routing sockets and messages for Darwin 5 // Routing sockets and messages for Darwin
6 6
7 package syscall 7 package syscall
8 8
9 import ( 9 import (
10 "unsafe" 10 "unsafe"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 buf := m.Data[:] 57 buf := m.Data[:]
58 for i := uint(0); i < RTAX_MAX; i++ { 58 for i := uint(0); i < RTAX_MAX; i++ {
59 if m.Header.Addrs&rtaIfmaMask&(1<<i) == 0 { 59 if m.Header.Addrs&rtaIfmaMask&(1<<i) == 0 {
60 continue 60 continue
61 } 61 }
62 rsa := (*RawSockaddr)(unsafe.Pointer(&buf[0])) 62 rsa := (*RawSockaddr)(unsafe.Pointer(&buf[0]))
63 switch i { 63 switch i {
64 case RTAX_IFA: 64 case RTAX_IFA:
65 sa, e := anyToSockaddr((*RawSockaddrAny)(unsafe.Pointer( rsa))) 65 sa, e := anyToSockaddr((*RawSockaddrAny)(unsafe.Pointer( rsa)))
66 » » » if e != 0 { 66 » » » if e != nil {
67 return nil 67 return nil
68 } 68 }
69 sas = append(sas, sa) 69 sas = append(sas, sa)
70 case RTAX_GATEWAY, RTAX_IFP: 70 case RTAX_GATEWAY, RTAX_IFP:
71 // nothing to do 71 // nothing to do
72 } 72 }
73 buf = buf[rsaAlignOf(int(rsa.Len)):] 73 buf = buf[rsaAlignOf(int(rsa.Len)):]
74 } 74 }
75 75
76 return sas 76 return sas
77 } 77 }
OLDNEW
« no previous file with comments | « src/pkg/syscall/route_bsd.go ('k') | src/pkg/syscall/route_freebsd.go » ('j') | no next file with comments »

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