Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

compiling fails on FreeBSD 13 #177

Closed
igalic opened this issue Feb 18, 2021 · 1 comment
Closed

compiling fails on FreeBSD 13 #177

igalic opened this issue Feb 18, 2021 · 1 comment

Comments

@igalic
Copy link
Contributor

igalic commented Feb 18, 2021

error[E0308]: mismatched types
   --> /home/meena/.cargo/registry/src/esyshub.st101.workers.dev-1ecc6299db9ec823/mdcat-0.22.2/src/terminal/size.rs:108:42
    |
108 |             let result = libc::ioctl(fd, libc::TIOCGWINSZ, &mut winsize);
    |                                          ^^^^^^^^^^^^^^^^
    |                                          |
    |                                          expected `u64`, found `u32`
    |                                          help: you can convert a `u32` to a `u64`: `libc::TIOCGWINSZ.into()`

error: aborting due to previous error

FreeBSD's ioctl(2) has a signature of:

int
ioctl(int fd, unsigned long request, ...);

What rustc suggests makes it compile (and works!), but i'm not sure if that won't throw off clippy on other platforms.

@swsnr
Copy link
Owner

swsnr commented Feb 19, 2021

🤷‍♂️ Try it? Make a pull request and we'll see if clippy is happy 🙂

igalic added a commit to igalic/mdcat that referenced this issue Feb 19, 2021
FreeBSD ioctl(2) takes unsigned long long as request parameter.
Here we automatically convert it with `.into()` to whatever the libc underneath needs

This fixes swsnr#177
igalic added a commit to igalic/mdcat that referenced this issue Feb 20, 2021
FreeBSD ioctl(2) takes unsigned long long as request parameter.
Here we automatically convert it with `.into()` to whatever the libc underneath needs

This fixes swsnr#177
@swsnr swsnr closed this as completed in d44fd01 Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants