From 0b01a9bb4b93e3f763b4ab924179462b415991d4 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sat, 14 Mar 2015 15:38:59 -0700 Subject: [PATCH 1/2] Fallout of c933d44f7bb9 --- src/libstd/sys/unix/backtrace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs index 3fa9f5d07aa20..74ab04978cbe2 100644 --- a/src/libstd/sys/unix/backtrace.rs +++ b/src/libstd/sys/unix/backtrace.rs @@ -118,7 +118,7 @@ pub fn write(w: &mut Write) -> io::Result<()> { // local, it still displays much nicer backtraces when a // couple of tasks panic simultaneously static LOCK: StaticMutex = MUTEX_INIT; - let _g = unsafe { LOCK.lock() }; + let _g = LOCK.lock(); try!(writeln!(w, "stack backtrace:")); // 100 lines should be enough From 04c947c13a180e00ce87970ac573862247c69cde Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sat, 14 Mar 2015 15:39:46 -0700 Subject: [PATCH 2/2] Implement `winsize()` for {ios,dragonfly} `sys/ttycom.h` in both: `#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */` --- src/libstd/sys/unix/tty.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/libstd/sys/unix/tty.rs b/src/libstd/sys/unix/tty.rs index f607f7c6a2f5a..e4973a8f9f383 100644 --- a/src/libstd/sys/unix/tty.rs +++ b/src/libstd/sys/unix/tty.rs @@ -23,6 +23,8 @@ pub struct TTY { } #[cfg(any(target_os = "macos", + target_os = "ios", + target_os = "dragonfly", target_os = "freebsd", target_os = "bitrig", target_os = "openbsd"))] @@ -54,12 +56,6 @@ impl TTY { Err(sys_common::unimpl()) } - #[cfg(any(target_os = "linux", - target_os = "android", - target_os = "macos", - target_os = "freebsd", - target_os = "bitrig", - target_os = "openbsd"))] pub fn get_winsize(&mut self) -> IoResult<(int, int)> { unsafe { #[repr(C)] @@ -82,10 +78,4 @@ impl TTY { } } } - - #[cfg(any(target_os = "ios", - target_os = "dragonfly"))] - pub fn get_winsize(&mut self) -> IoResult<(int, int)> { - Err(sys_common::unimpl()) - } }