Skip to content

Commit e3bb695

Browse files
committed
Add comment about TIOCGWINSZ .into().
1 parent 61c1b1c commit e3bb695

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cargo/core/shell.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ mod imp {
377377
pub fn stderr_width() -> Option<usize> {
378378
unsafe {
379379
let mut winsize: libc::winsize = mem::zeroed();
380+
// The .into() here is needed for FreeBSD which defines TIOCGWINSZ
381+
// as c_uint but ioctl wants c_ulong.
380382
if libc::ioctl(libc::STDERR_FILENO, libc::TIOCGWINSZ.into(), &mut winsize) < 0 {
381383
return None;
382384
}

0 commit comments

Comments
 (0)