Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hermit-rs
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
HermitOS
hermit-rs
Commits
2108f755
Verified
Commit
2108f755
authored
4 months ago
by
Martin Kröning
Browse files
Options
Downloads
Patches
Plain Diff
fix(wasmtime): cast to `c_char` instead of `i8`
parent
b25fde39
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/wasmtime/src/preview1.rs
+2
-1
2 additions, 1 deletion
examples/wasmtime/src/preview1.rs
with
2 additions
and
1 deletion
examples/wasmtime/src/preview1.rs
+
2
−
1
View file @
2108f755
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
// working directory of the WASI application.
// working directory of the WASI application.
use
std
::
cmp
::
Ordering
;
use
std
::
cmp
::
Ordering
;
use
std
::
ffi
::
c_char
;
use
std
::
mem
::
MaybeUninit
;
use
std
::
mem
::
MaybeUninit
;
use
std
::
sync
::{
Mutex
,
OnceLock
};
use
std
::
sync
::{
Mutex
,
OnceLock
};
use
std
::
time
::{
Instant
,
SystemTime
,
UNIX_EPOCH
};
use
std
::
time
::{
Instant
,
SystemTime
,
UNIX_EPOCH
};
...
@@ -208,7 +209,7 @@ pub(crate) fn init<T>(linker: &mut wasmtime::Linker<T>) -> Result<()> {
...
@@ -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
());
c_path
[
..
path
.len
()]
.copy_from_slice
(
path
.as_bytes
());
{
{
let
raw_fd
=
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
();
let
mut
guard
=
FD
.lock
()
.unwrap
();
for
(
i
,
entry
)
in
guard
.iter_mut
()
.enumerate
()
{
for
(
i
,
entry
)
in
guard
.iter_mut
()
.enumerate
()
{
if
entry
.is_none
()
{
if
entry
.is_none
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment