Skip to content

Commit f5a2119

Browse files
author
Andrea Righi
committed
scx_utils: use c_char to prevent build failures
Use c_char to convert C strings, that is more portable across different architectures. This prevents a build failure on arm64 and ppc64el. Fixes: d57a23f ("rust/scx_utils: Add user_exit_info support") Signed-off-by: Andrea Righi <[email protected]>
1 parent b5f3f7f commit f5a2119

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rust/scx_utils/src/user_exit_info.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::bindings;
66
use anyhow::bail;
77
use anyhow::Result;
88
use std::ffi::CStr;
9+
use std::os::raw::c_char;
910

1011
pub enum ScxExitKind {
1112
None = bindings::scx_exit_kind_SCX_EXIT_NONE as isize,
@@ -71,9 +72,9 @@ impl UserExitInfo {
7172
/// type which then calls this method with the individual fields.
7273
pub fn new(
7374
kind_ptr: *const i32,
74-
reason_ptr: *const i8,
75-
msg_ptr: *const i8,
76-
dump_ptr: *const i8,
75+
reason_ptr: *const c_char,
76+
msg_ptr: *const c_char,
77+
dump_ptr: *const c_char,
7778
) -> Self {
7879
let kind = unsafe { std::ptr::read_volatile(kind_ptr) };
7980

0 commit comments

Comments
 (0)