From 398e31fa3789f0574a6ff679742dfb7639984e12 Mon Sep 17 00:00:00 2001 From: johalun Date: Thu, 12 Jan 2017 13:16:09 -0800 Subject: Make it run on FreeBSD --- src/tty.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tty.rs') diff --git a/src/tty.rs b/src/tty.rs index c9feae36..0f885d52 100644 --- a/src/tty.rs +++ b/src/tty.rs @@ -20,7 +20,7 @@ use std::fs::File; use std::os::unix::io::FromRawFd; use std::ptr; -use libc::{self, winsize, c_int, pid_t, WNOHANG, WIFEXITED, WEXITSTATUS, SIGCHLD}; +use libc::{self, winsize, c_int, pid_t, WNOHANG, WIFEXITED, WEXITSTATUS, SIGCHLD, TIOCSCTTY}; use term::SizeInfo; use display::OnResize; @@ -112,7 +112,7 @@ fn openpty(rows: u8, cols: u8) -> (c_int, c_int) { (master, slave) } -#[cfg(target_os = "macos")] +#[cfg(any(target_os = "macos",target_os = "freebsd"))] fn openpty(rows: u8, cols: u8) -> (c_int, c_int) { let mut master: c_int = 0; let mut slave: c_int = 0; @@ -138,7 +138,7 @@ fn openpty(rows: u8, cols: u8) -> (c_int, c_int) { /// Really only needed on BSD, but should be fine elsewhere fn set_controlling_terminal(fd: c_int) { let res = unsafe { - libc::ioctl(fd, libc::TIOCSCTTY as _, 0) + libc::ioctl(fd, TIOCSCTTY as _, 0) }; if res < 0 { -- cgit