about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNODA, Kai <nodakai@gmail.com>2014-09-22 09:29:39 +0800
committerNODA, Kai <nodakai@gmail.com>2014-09-24 10:36:40 +0800
commitd4b7bdae33fbd80da27b02d40211e926fff7ac6d (patch)
tree00a7a23bf59e70dc14e70ac7fc8596fdfe38fe01
parent24bd8124eac3e3ac6c51527e21bbc9f0f3a9c298 (diff)
downloadrust-d4b7bdae33fbd80da27b02d40211e926fff7ac6d.tar.gz
rust-d4b7bdae33fbd80da27b02d40211e926fff7ac6d.zip
liblibc and libnative: send() should use const buffers.
-rw-r--r--src/liblibc/lib.rs4
-rw-r--r--src/libnative/io/net.rs2
-rw-r--r--src/libnative/io/pipe_unix.rs2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs
index 35b05a672b2..494c98bc54d 100644
--- a/src/liblibc/lib.rs
+++ b/src/liblibc/lib.rs
@@ -4633,7 +4633,7 @@ pub mod funcs {
                               option_len: socklen_t) -> c_int;
             pub fn recv(socket: c_int, buf: *mut c_void, len: size_t,
                         flags: c_int) -> ssize_t;
-            pub fn send(socket: c_int, buf: *mut c_void, len: size_t,
+            pub fn send(socket: c_int, buf: *const c_void, len: size_t,
                         flags: c_int) -> ssize_t;
             pub fn recvfrom(socket: c_int, buf: *mut c_void, len: size_t,
                             flags: c_int, addr: *mut sockaddr,
@@ -4673,7 +4673,7 @@ pub mod funcs {
             pub fn closesocket(socket: SOCKET) -> c_int;
             pub fn recv(socket: SOCKET, buf: *mut c_void, len: c_int,
                         flags: c_int) -> c_int;
-            pub fn send(socket: SOCKET, buf: *mut c_void, len: c_int,
+            pub fn send(socket: SOCKET, buf: *const c_void, len: c_int,
                         flags: c_int) -> c_int;
             pub fn recvfrom(socket: SOCKET, buf: *mut c_void, len: c_int,
                             flags: c_int, addr: *mut sockaddr,
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs
index 8418e741167..335a52b0bbe 100644
--- a/src/libnative/io/net.rs
+++ b/src/libnative/io/net.rs
@@ -337,7 +337,7 @@ impl rtio::RtioTcpStream for TcpStream {
         let dowrite = |nb: bool, buf: *const u8, len: uint| unsafe {
             let flags = if nb {c::MSG_DONTWAIT} else {0};
             libc::send(fd,
-                       buf as *mut libc::c_void,
+                       buf as *const _,
                        len as wrlen,
                        flags) as i64
         };
diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs
index c222907fa5b..48f31615339 100644
--- a/src/libnative/io/pipe_unix.rs
+++ b/src/libnative/io/pipe_unix.rs
@@ -173,7 +173,7 @@ impl rtio::RtioPipe for UnixStream {
         let dowrite = |nb: bool, buf: *const u8, len: uint| unsafe {
             let flags = if nb {c::MSG_DONTWAIT} else {0};
             libc::send(fd,
-                       buf as *mut libc::c_void,
+                       buf as *const _,
                        len as libc::size_t,
                        flags) as i64
         };