diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-01-14 04:22:19 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-01-14 11:04:42 +0530 |
| commit | 837a8decb6f7ca27718fa6f75391ba04f7d37753 (patch) | |
| tree | 3920402c3fa430c0d07026de9e9eb97e6765d21a /src/libstd/sys | |
| parent | 4ff1d20ad71c01adcaa61ea1c11f3ea14ce8c983 (diff) | |
| parent | 667ee8a57b86f5f3e12ff9bd780d6f16dc4129d8 (diff) | |
| download | rust-837a8decb6f7ca27718fa6f75391ba04f7d37753.tar.gz rust-837a8decb6f7ca27718fa6f75391ba04f7d37753.zip | |
Rollup merge of #30837 - semarie:openbsd-libc, r=alexcrichton
The following PR updates libc version to latest commits for correctly support openbsd. It corrects several points in rustc to be compatible with libc changes. r? @alexcrichton
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/unix/stack_overflow.rs | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index e8575a6c21c..10fda3fcd7f 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -204,7 +204,8 @@ impl DirEntry { #[cfg(any(target_os = "macos", target_os = "ios", - target_os = "netbsd"))] + target_os = "netbsd", + target_os = "openbsd"))] fn name_bytes(&self) -> &[u8] { unsafe { ::slice::from_raw_parts(self.entry.d_name.as_ptr() as *const u8, @@ -213,8 +214,7 @@ impl DirEntry { } #[cfg(any(target_os = "freebsd", target_os = "dragonfly", - target_os = "bitrig", - target_os = "openbsd"))] + target_os = "bitrig"))] fn name_bytes(&self) -> &[u8] { unsafe { ::slice::from_raw_parts(self.entry.d_name.as_ptr() as *const u8, diff --git a/src/libstd/sys/unix/stack_overflow.rs b/src/libstd/sys/unix/stack_overflow.rs index 776acd20b06..fc49f4257be 100644 --- a/src/libstd/sys/unix/stack_overflow.rs +++ b/src/libstd/sys/unix/stack_overflow.rs @@ -59,19 +59,19 @@ mod imp { static mut PAGE_SIZE: usize = 0; #[cfg(any(target_os = "linux", target_os = "android"))] - unsafe fn siginfo_si_addr(info: *mut libc::siginfo_t) -> *mut libc::c_void { + unsafe fn siginfo_si_addr(info: *mut libc::siginfo_t) -> usize { #[repr(C)] struct siginfo_t { a: [libc::c_int; 3], // si_signo, si_code, si_errno, si_addr: *mut libc::c_void, } - (*(info as *const siginfo_t)).si_addr + (*(info as *const siginfo_t)).si_addr as usize } #[cfg(not(any(target_os = "linux", target_os = "android")))] - unsafe fn siginfo_si_addr(info: *mut libc::siginfo_t) -> *mut libc::c_void { - (*info).si_addr + unsafe fn siginfo_si_addr(info: *mut libc::siginfo_t) -> usize { + (*info).si_addr as usize } // Signal handler for the SIGSEGV and SIGBUS handlers. We've got guard pages @@ -98,7 +98,7 @@ mod imp { use sys_common::util::report_overflow; let guard = thread_info::stack_guard().unwrap_or(0); - let addr = siginfo_si_addr(info) as usize; + let addr = siginfo_si_addr(info); // If the faulting address is within the guard page, then we print a // message saying so. |
