lluiscab / MPQTT

MPQTT is a linux program used to extract data from Voltronic / Axpert / MasterPower inverters and sending it to MQTT for use in Home Assistant
10 stars 4 forks source link

const i8 compilation error #9

Open argulp opened 11 months ago

argulp commented 11 months ago
Hi I'm not a rust expert, but during cargo build: error[E0308]: mismatched types --> src/main.rs:186:28 186 let fd = unsafe { open(path.as_ref().as_os_str().as_bytes().as_ptr() as *const i8, O_RDWR) }; ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u8, found i8
arguments to this function are incorrect
= note: expected raw pointer `*const u8`
           found raw pointer `*const i8`

note: function defined here --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.72/src/unix/mod.rs:718:12 | 718 | pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int; | ^^^^

switching i8 to u8 fix the issue

Rgds