]> git.lizzy.rs Git - rust.git/blobdiff - src/libnative/io/pipe_win32.rs
auto merge of #14301 : alexcrichton/rust/remove-unsafe-arc, r=brson
[rust.git] / src / libnative / io / pipe_win32.rs
index c9dbdc8331bbe265a95e043c3efd02371849e279..cd4cbf2c90f32e79f9971e37e6eca3de8d5d20a4 100644 (file)
@@ -87,8 +87,8 @@
 use alloc::arc::Arc;
 use libc;
 use std::c_str::CString;
-use std::intrinsics;
 use std::io;
+use std::mem;
 use std::os::win32::as_utf16_p;
 use std::os;
 use std::ptr;
@@ -345,7 +345,7 @@ fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
         }
 
         let mut bytes_read = 0;
-        let mut overlapped: libc::OVERLAPPED = unsafe { intrinsics::init() };
+        let mut overlapped: libc::OVERLAPPED = unsafe { mem::zeroed() };
         overlapped.hEvent = self.read.get_ref().handle();
 
         // Pre-flight check to see if the reading half has been closed. This
@@ -417,7 +417,7 @@ fn write(&mut self, buf: &[u8]) -> IoResult<()> {
         }
 
         let mut offset = 0;
-        let mut overlapped: libc::OVERLAPPED = unsafe { intrinsics::init() };
+        let mut overlapped: libc::OVERLAPPED = unsafe { mem::zeroed() };
         overlapped.hEvent = self.write.get_ref().handle();
 
         while offset < buf.len() {
@@ -633,7 +633,7 @@ pub fn native_accept(&mut self) -> IoResult<UnixStream> {
         // someone on the other end connects. This function can "fail" if a
         // client connects after we created the pipe but before we got down
         // here. Thanks windows.
-        let mut overlapped: libc::OVERLAPPED = unsafe { intrinsics::init() };
+        let mut overlapped: libc::OVERLAPPED = unsafe { mem::zeroed() };
         overlapped.hEvent = self.event.handle();
         if unsafe { libc::ConnectNamedPipe(handle, &mut overlapped) == 0 } {
             let mut err = unsafe { libc::GetLastError() };