From 2108f75502891c2f3cc7fdd79633d11861822a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= <martin.kroening@eonerc.rwth-aachen.de> Date: Wed, 18 Dec 2024 16:02:59 +0100 Subject: [PATCH] fix(wasmtime): cast to `c_char` instead of `i8` --- examples/wasmtime/src/preview1.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/wasmtime/src/preview1.rs b/examples/wasmtime/src/preview1.rs index b5dd0d10..8d128781 100644 --- a/examples/wasmtime/src/preview1.rs +++ b/examples/wasmtime/src/preview1.rs @@ -6,6 +6,7 @@ // working directory of the WASI application. use std::cmp::Ordering; +use std::ffi::c_char; use std::mem::MaybeUninit; use std::sync::{Mutex, OnceLock}; use std::time::{Instant, SystemTime, UNIX_EPOCH}; @@ -208,7 +209,7 @@ pub(crate) fn init<T>(linker: &mut wasmtime::Linker<T>) -> Result<()> { c_path[..path.len()].copy_from_slice(path.as_bytes()); { let raw_fd = - unsafe { hermit_abi::open(c_path.as_ptr() as *const i8, flags, 0) }; + unsafe { hermit_abi::open(c_path.as_ptr() as *const c_char, flags, 0) }; let mut guard = FD.lock().unwrap(); for (i, entry) in guard.iter_mut().enumerate() { if entry.is_none() { -- GitLab