From d4b7bdae33fbd80da27b02d40211e926fff7ac6d Mon Sep 17 00:00:00 2001 From: "NODA, Kai" Date: Mon, 22 Sep 2014 09:29:39 +0800 Subject: liblibc and libnative: send() should use const buffers. --- src/libnative/io/net.rs | 2 +- src/libnative/io/pipe_unix.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libnative') 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 }; -- cgit 1.4.1-3-g733a5