@@ -14,7 +14,7 @@ use std::cast;
14
14
use std:: io:: IoError ;
15
15
use std:: libc;
16
16
use std:: libc:: { c_char, c_int} ;
17
- use std:: ptr:: null;
17
+ use std:: ptr:: { null, mut_null } ;
18
18
19
19
use super :: net:: sockaddr_to_addr;
20
20
@@ -42,13 +42,13 @@ impl GetAddrInfoRequest {
42
42
} ) ;
43
43
44
44
let hint_ptr = hint. as_ref ( ) . map_or ( null ( ) , |x| x as * libc:: addrinfo ) ;
45
- let res = null ( ) ;
45
+ let mut res = mut_null ( ) ;
46
46
47
47
// Make the call
48
48
let s = unsafe {
49
49
let ch = if c_host. is_null ( ) { null ( ) } else { c_host. with_ref ( |x| x) } ;
50
50
let cs = if c_serv. is_null ( ) { null ( ) } else { c_serv. with_ref ( |x| x) } ;
51
- getaddrinfo ( ch, cs, hint_ptr, & res)
51
+ getaddrinfo ( ch, cs, hint_ptr, & mut res)
52
52
} ;
53
53
54
54
// Error?
@@ -74,7 +74,7 @@ impl GetAddrInfoRequest {
74
74
flags : ( * rp) . ai_flags as uint
75
75
} ) ;
76
76
77
- rp = ( * rp) . ai_next ;
77
+ rp = ( * rp) . ai_next as * mut libc :: addrinfo ;
78
78
}
79
79
}
80
80
@@ -86,8 +86,8 @@ impl GetAddrInfoRequest {
86
86
87
87
extern "system" {
88
88
fn getaddrinfo ( node : * c_char , service : * c_char ,
89
- hints : * libc:: addrinfo , res : * * libc:: addrinfo ) -> c_int ;
90
- fn freeaddrinfo ( res : * libc:: addrinfo ) ;
89
+ hints : * libc:: addrinfo , res : * mut * mut libc:: addrinfo ) -> c_int ;
90
+ fn freeaddrinfo ( res : * mut libc:: addrinfo ) ;
91
91
#[ cfg( not( windows) ) ]
92
92
fn gai_strerror ( errcode : c_int ) -> * c_char ;
93
93
#[ cfg( windows) ]
0 commit comments