lib: fix compiling error for type i8 in aarch64 environment

c_char is equal to i8 on x86, but it is equal to u8 on arm arch,
so we need to use type c_char instead of i8 to avoid compiling error.

Fixes: #9

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
This commit is contained in:
zhanghj
2020-09-21 05:40:57 -04:00
parent 3852d7c180
commit cd7e737149

View File

@@ -766,7 +766,7 @@ pub fn nested_keyed_to_hashmap(mut file: File) -> Result<HashMap<String, HashMap
/// with error: `Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }`
pub fn libc_rmdir(p: &str) {
// with int return value
let _ = unsafe { libc::rmdir(p.as_ptr() as *const i8) };
let _ = unsafe { libc::rmdir(p.as_ptr() as *const libc::c_char) };
}
/// read and parse an i64 data