Skip to content
This repository was archived by the owner on May 17, 2018. It is now read-only.

Commit e6c4912

Browse files
committed
fix build with rust 1.4.0
1 parent ab782fa commit e6c4912

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ impl IntoRawFd for UnixDatagram {
13301330
#[cfg(test)]
13311331
mod test {
13321332
extern crate tempdir;
1333+
extern crate libc;
13331334

13341335
use std::thread;
13351336
use std::io;
@@ -1434,14 +1435,18 @@ mod test {
14341435
#[cfg(target_os = "linux")]
14351436
fn abstract_address_max_len() {
14361437
use os::linux::SocketAddrExt;
1438+
use std::ffi::OsStr;
1439+
use std::io::Write;
1440+
use std::mem;
1441+
use std::os::unix::ffi::OsStrExt;
14371442

14381443
let len = unsafe {
14391444
let addr: libc::sockaddr_un = mem::zeroed();
14401445
addr.sun_path.len()
14411446
};
14421447

14431448
let mut socket_path = vec![0; len];
1444-
socket_path[1..9].copy_from_slice(b"the path");
1449+
(&mut socket_path[1..9]).write_all(b"the path").unwrap();
14451450
let socket_path: &OsStr = OsStr::from_bytes(&socket_path).into();
14461451

14471452
let msg1 = b"hello";

0 commit comments

Comments
 (0)