diff options
| author | bors <bors@rust-lang.org> | 2014-06-14 06:36:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-06-14 06:36:49 +0000 |
| commit | 18c451fc497a23944b7b759cca5ff0b0be1122fd (patch) | |
| tree | 6d51b100a0e6a6b2f1b6c95b28b36125cacad5e5 /src/libnative | |
| parent | 2c6caad1bab0660ce8b4797c10d5530964d6e8d9 (diff) | |
| parent | 6fc788916c297d6e03464b80f12ba0e62fccccac (diff) | |
| download | rust-18c451fc497a23944b7b759cca5ff0b0be1122fd.tar.gz rust-18c451fc497a23944b7b759cca5ff0b0be1122fd.zip | |
auto merge of #14739 : zwarich/rust/mut-unique-path, r=nikomatsakis
Implement the stronger guarantees for mutable borrows proposed in #12624.
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/net.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index e7effbd6bdb..1c33114dc71 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -637,7 +637,7 @@ impl rtio::RtioUdpSocket for UdpSocket { mem::size_of::<libc::sockaddr_storage>() as libc::socklen_t; let dolock = || self.lock_nonblocking(); - let doread = |nb| unsafe { + let n = try!(read(fd, self.read_deadline, dolock, |nb| unsafe { let flags = if nb {c::MSG_DONTWAIT} else {0}; libc::recvfrom(fd, buf.as_mut_ptr() as *mut libc::c_void, @@ -645,8 +645,7 @@ impl rtio::RtioUdpSocket for UdpSocket { flags, storagep, &mut addrlen) as libc::c_int - }; - let n = try!(read(fd, self.read_deadline, dolock, doread)); + })); sockaddr_to_addr(&storage, addrlen as uint).and_then(|addr| { Ok((n as uint, addr)) }) |
