about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-04-07 15:40:47 -0700
committerbors <bors@rust-lang.org>2016-04-07 15:40:47 -0700
commitdde35e75a30129fdc61bb179023a9f0dbdc7a79a (patch)
treefb2b3936d3a0aa04dde650139e46f46133e99cd1 /src/libstd/sys
parent7979dd6089ee5cba39cfbe6e880a3edeb7fff788 (diff)
parent1d59b91ed4ba0e832846c9cbe1188e374e1056f3 (diff)
downloadrust-dde35e75a30129fdc61bb179023a9f0dbdc7a79a.tar.gz
rust-dde35e75a30129fdc61bb179023a9f0dbdc7a79a.zip
Auto merge of #32800 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #32687, #32729, #32731, #32732, #32734, #32737, #32741
- Failed merges:
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/unwind/gcc.rs7
-rw-r--r--src/libstd/sys/unix/os.rs12
-rw-r--r--src/libstd/sys/unix/time.rs7
3 files changed, 23 insertions, 3 deletions
diff --git a/src/libstd/sys/common/unwind/gcc.rs b/src/libstd/sys/common/unwind/gcc.rs
index ff6a11951dc..da7a340af35 100644
--- a/src/libstd/sys/common/unwind/gcc.rs
+++ b/src/libstd/sys/common/unwind/gcc.rs
@@ -224,8 +224,13 @@ pub mod eabi {
         context: *mut uw::_Unwind_Context
     ) -> uw::_Unwind_Reason_Code
     {
+        // Backtraces on ARM will call the personality routine with
+        // state == _US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND. In those cases
+        // we want to continue unwinding the stack, otherwise all our backtraces
+        // would end at __rust_try.
         if (state as c_int & uw::_US_ACTION_MASK as c_int)
-                           == uw::_US_VIRTUAL_UNWIND_FRAME as c_int { // search phase
+                           == uw::_US_VIRTUAL_UNWIND_FRAME as c_int
+               && (state as c_int & uw::_US_FORCE_UNWIND as c_int) == 0 { // search phase
             uw::_URC_HANDLER_FOUND // catch!
         }
         else { // cleanup phase
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs
index eed62c9ecfd..94ebbd70ae8 100644
--- a/src/libstd/sys/unix/os.rs
+++ b/src/libstd/sys/unix/os.rs
@@ -36,6 +36,7 @@ const TMPBUF_SZ: usize = 128;
 static ENV_LOCK: StaticMutex = StaticMutex::new();
 
 /// Returns the platform-specific value of errno
+#[cfg(not(target_os = "dragonfly"))]
 pub fn errno() -> i32 {
     extern {
         #[cfg_attr(any(target_os = "linux", target_os = "emscripten"),
@@ -47,7 +48,6 @@ pub fn errno() -> i32 {
                        target_env = "newlib"),
                    link_name = "__errno")]
         #[cfg_attr(target_os = "solaris", link_name = "___errno")]
-        #[cfg_attr(target_os = "dragonfly", link_name = "__dfly_error")]
         #[cfg_attr(any(target_os = "macos",
                        target_os = "ios",
                        target_os = "freebsd"),
@@ -60,6 +60,16 @@ pub fn errno() -> i32 {
     }
 }
 
+#[cfg(target_os = "dragonfly")]
+pub fn errno() -> i32 {
+    extern {
+        #[thread_local]
+        static errno: c_int;
+    }
+
+    errno as i32
+}
+
 /// Gets a detailed string description for the given error number.
 pub fn error_string(errno: i32) -> String {
     extern {
diff --git a/src/libstd/sys/unix/time.rs b/src/libstd/sys/unix/time.rs
index 1444cf31e85..cc7abe25e35 100644
--- a/src/libstd/sys/unix/time.rs
+++ b/src/libstd/sys/unix/time.rs
@@ -303,8 +303,13 @@ mod inner {
         }
     }
 
+    #[cfg(not(target_os = "dragonfly"))]
+    pub type clock_t = libc::c_int;
+    #[cfg(target_os = "dragonfly")]
+    pub type clock_t = libc::c_ulong;
+
     impl Timespec {
-        pub fn now(clock: libc::c_int) -> Timespec {
+        pub fn now(clock: clock_t) -> Timespec {
             let mut t = Timespec {
                 t: libc::timespec {
                     tv_sec: 0,