Skip to content

Commit

Permalink
Merge pull request #13 from gchers/master
Browse files Browse the repository at this point in the history
Fix ioctl() call compilation error for freebsd
  • Loading branch information
murarth committed Sep 6, 2017
2 parents 731725f + 28ed48a commit ee314dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/unix/terminal.rs
Expand Up @@ -395,7 +395,10 @@ struct Winsize {
fn get_winsize(fd: c_int) -> io::Result<Winsize> {
let mut winsz: Winsize = unsafe { zeroed() };

let res = unsafe { ioctl(fd, TIOCGWINSZ, &mut winsz) };
// NOTE: this ".into()" is added as a temporary fix to a libc
// bug described in:
// https://github.com/rust-lang/libc/pull/704
let res = unsafe { ioctl(fd, TIOCGWINSZ.into(), &mut winsz) };

if res == -1 {
Err(io::Error::last_os_error())
Expand Down

0 comments on commit ee314dc

Please sign in to comment.