Skip to content

Commit

Permalink
Fix build on ARM / POWER (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubaj committed Apr 16, 2021
1 parent 42c91c4 commit 3e65e8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/param.rs
Expand Up @@ -640,7 +640,7 @@ pub fn get(jid: i32, name: &str) -> Result<Value, JailError> {
)
};

let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) }
let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) }
.to_string_lossy()
.to_string();

Expand Down Expand Up @@ -676,7 +676,7 @@ pub fn get(jid: i32, name: &str) -> Result<Value, JailError> {
Type::S32 => Ok(Value::S32(LittleEndian::read_i32(&value))),
Type::U32 => Ok(Value::U32(LittleEndian::read_u32(&value))),
Type::String => Ok(Value::String({
unsafe { CStr::from_ptr(value.as_ptr() as *mut i8) }
unsafe { CStr::from_ptr(value.as_ptr() as *mut libc::c_char) }
.to_string_lossy()
.into_owned()
})),
Expand Down Expand Up @@ -807,7 +807,7 @@ pub fn set(jid: i32, name: &str, value: Value) -> Result<(), JailError> {
)
};

let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) }
let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) }
.to_string_lossy()
.to_string();

Expand Down
8 changes: 4 additions & 4 deletions src/sys.rs
Expand Up @@ -113,7 +113,7 @@ pub fn jail_create(
)
};

let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) }
let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) }
.to_string_lossy()
.to_string();

Expand Down Expand Up @@ -171,7 +171,7 @@ pub fn jail_clearpersist(jid: i32) -> Result<(), JailError> {
)
};

let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) }
let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) }
.to_string_lossy()
.to_string();

Expand Down Expand Up @@ -213,7 +213,7 @@ pub fn jail_getid(name: &str) -> Result<i32, JailError> {
)
};

let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) }
let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) }
.to_string_lossy()
.to_string();

Expand Down Expand Up @@ -248,7 +248,7 @@ pub fn jail_nextjid(lastjid: i32) -> Result<i32, JailError> {
)
};

let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut i8) }
let err = unsafe { CStr::from_ptr(errmsg.as_ptr() as *mut libc::c_char) }
.to_string_lossy()
.to_string();

Expand Down

0 comments on commit 3e65e8a

Please sign in to comment.