From 2e653268c8bd0b550d5146344cc6e07d8d9e77e5 Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Mon, 23 Sep 2024 04:21:12 +0900 Subject: [PATCH] fix error in type conversion --- src/main.rs | 2 +- src/unix.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 64d7e01..1ed3df4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -123,7 +123,7 @@ fn replace_root() -> Result<(), String> { } #[no_mangle] -unsafe extern "C" fn main(_argc: c_int, argv: *mut *const u8) -> c_int { +unsafe extern "C" fn main(_argc: c_int, argv: *mut *const i8) -> c_int { init_kmsg(); match replace_root() { diff --git a/src/unix.rs b/src/unix.rs index 5c51ab9..f1511cd 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -130,7 +130,7 @@ pub(crate) fn do_rmdir(path: &str) -> SystemResult { } } -pub(crate) fn do_execv(path: &str, argv: *mut *const u8) -> SystemResult { +pub(crate) fn do_execv(path: &str, argv: *mut *const i8) -> SystemResult { let raw_init_path = CString::new(path).unwrap(); unsafe { *argv = raw_init_path.as_ref().as_ptr();