about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/rt/unwind.rs2
-rw-r--r--src/libstd/sys/common/net.rs4
-rw-r--r--src/libstd/sys/windows/c.rs1
-rw-r--r--src/libstd/sys/windows/tcp.rs5
4 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs
index e4927bbd3d2..f71811b1ead 100644
--- a/src/libstd/rt/unwind.rs
+++ b/src/libstd/rt/unwind.rs
@@ -398,7 +398,7 @@ pub mod eabi {
     pub struct DISPATCHER_CONTEXT;
 
     #[repr(C)]
-    #[derive(Copy)]
+    #[derive(Copy, Clone)]
     pub enum EXCEPTION_DISPOSITION {
         ExceptionContinueExecution,
         ExceptionContinueSearch,
diff --git a/src/libstd/sys/common/net.rs b/src/libstd/sys/common/net.rs
index 1a0ee17904a..fc21effb45a 100644
--- a/src/libstd/sys/common/net.rs
+++ b/src/libstd/sys/common/net.rs
@@ -115,9 +115,9 @@ pub fn socket(addr: SocketAddr, ty: libc::c_int) -> IoResult<sock_t> {
             Ipv4Addr(..) => libc::AF_INET,
             Ipv6Addr(..) => libc::AF_INET6,
         };
-        match libc::socket(fam, ty, 0) {
+        match libc::socket(fam, ty, 0) as i32 {
             -1 => Err(last_net_error()),
-            fd => Ok(fd),
+            fd => Ok(fd as sock_t),
         }
     }
 }
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs
index 99abe10c8a4..4804f650441 100644
--- a/src/libstd/sys/windows/c.rs
+++ b/src/libstd/sys/windows/c.rs
@@ -89,7 +89,6 @@ pub type LPWSANETWORKEVENTS = *mut WSANETWORKEVENTS;
 pub type WSAEVENT = libc::HANDLE;
 
 #[repr(C)]
-#[derive(Copy)]
 pub struct WSAPROTOCOL_INFO {
     pub dwServiceFlags1: libc::DWORD,
     pub dwServiceFlags2: libc::DWORD,
diff --git a/src/libstd/sys/windows/tcp.rs b/src/libstd/sys/windows/tcp.rs
index 2ac8ac10aa9..41e97dc8475 100644
--- a/src/libstd/sys/windows/tcp.rs
+++ b/src/libstd/sys/windows/tcp.rs
@@ -15,6 +15,7 @@ use prelude::v1::*;
 use old_io::net::ip;
 use old_io::IoResult;
 use libc;
+use libc::consts::os::extra::INVALID_SOCKET;
 use mem;
 use ptr;
 use super::{last_error, last_net_error, sock_t};
@@ -183,8 +184,8 @@ impl TcpAcceptor {
             match unsafe {
                 libc::accept(self.socket(), ptr::null_mut(), ptr::null_mut())
             } {
-                -1 if wouldblock() => {}
-                -1 => return Err(last_net_error()),
+                INVALID_SOCKET if wouldblock() => {}
+                INVALID_SOCKET => return Err(last_net_error()),
 
                 // Accepted sockets inherit the same properties as the caller,
                 // so we need to deregister our event and switch the socket back