about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-02 07:19:33 +0000
committerbors <bors@rust-lang.org>2015-04-02 07:19:33 +0000
commitcf00fc4da984481a75229ce1e40f339f292d2166 (patch)
tree460e4d59504435411421cf261c5735a726f16942 /src/libstd/sys/windows
parent2e3b0c051dca9880bf66b5366dccd2e0bb424b99 (diff)
parente3b7e6caa25bffcffe6b04f550f551e1ae086f6b (diff)
downloadrust-cf00fc4da984481a75229ce1e40f339f292d2166.tar.gz
rust-cf00fc4da984481a75229ce1e40f339f292d2166.zip
Auto merge of #23963 - alexcrichton:rollup, r=alexcrichton

Diffstat (limited to 'src/libstd/sys/windows')
-rw-r--r--src/libstd/sys/windows/c.rs7
-rw-r--r--src/libstd/sys/windows/tcp.rs5
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/sys/windows/c.rs b/src/libstd/sys/windows/c.rs
index e74de595f97..4804f650441 100644
--- a/src/libstd/sys/windows/c.rs
+++ b/src/libstd/sys/windows/c.rs
@@ -49,9 +49,9 @@ pub const ERROR_NO_MORE_FILES: libc::DWORD = 18;
 pub const TOKEN_READ: libc::DWORD = 0x20008;
 
 // Note that these are not actually HANDLEs, just values to pass to GetStdHandle
-pub const STD_INPUT_HANDLE: libc::DWORD = -10;
-pub const STD_OUTPUT_HANDLE: libc::DWORD = -11;
-pub const STD_ERROR_HANDLE: libc::DWORD = -12;
+pub const STD_INPUT_HANDLE: libc::DWORD = -10i32 as libc::DWORD;
+pub const STD_OUTPUT_HANDLE: libc::DWORD = -11i32 as libc::DWORD;
+pub const STD_ERROR_HANDLE: libc::DWORD = -12i32 as libc::DWORD;
 
 #[repr(C)]
 #[cfg(target_arch = "x86")]
@@ -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