From 11a0ee178aa069b0f0226b3b260f2f783c1257c1 Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 24 Mar 2017 23:48:36 +0300 Subject: [PATCH] Fix terminal size ioctl number on *BSD (#98) At least on FreeBSD and OpenBSD, TIOCGWINSZ == 0x40087468 just like on macOS, so change the definition from not-macOS/macOS to Linux/non-Linux. --- src/termios.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/termios.rs b/src/termios.rs index d387c8a..6da58cc 100644 --- a/src/termios.rs +++ b/src/termios.rs @@ -3,10 +3,10 @@ use std::mem; pub use libc::termios as Termios; -#[cfg(not(target_os = "macos"))] +#[cfg(target_os = "linux")] pub const TIOCGWINSZ: usize = 0x00005413; -#[cfg(target_os = "macos")] +#[cfg(not(target_os = "linux"))] pub const TIOCGWINSZ: usize = 0x40087468; extern {