diff options
author | Allen Webb <allenwebb@google.com> | 2021-04-21 10:35:20 -0500 |
---|---|---|
committer | Allen Webb <allenwebb@google.com> | 2021-04-21 10:36:15 -0500 |
commit | 11395a6982fe8b09e3f2b0beb6c10e978266c4fa (patch) | |
tree | ed9e2ba99262f6bc53486bbc24a947f4b894bee2 | |
parent | f16b78b4235cdc5dc22226c041c219d9ebfc18b0 (diff) | |
download | minijail-11395a6982fe8b09e3f2b0beb6c10e978266c4fa.tar.gz |
rust/minijail: Fix cast to c_char.
Original casts were to i8 but should have been to c_char.
Bug: None
Test: cargo test -- --test-threads=1
Change-Id: I77fe69a0b6c1ede60dd5d81e56567dab090c6e8a
-rw-r--r-- | rust/minijail/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/minijail/src/lib.rs b/rust/minijail/src/lib.rs index 8500a1f..ba9c8af 100644 --- a/rust/minijail/src/lib.rs +++ b/rust/minijail/src/lib.rs @@ -885,9 +885,9 @@ mod tests { // Using libc to open/close FDs for testing. const FILE_PATH: &[u8] = b"/dev/null\0"; let j = Minijail::new().unwrap(); - let first = libc::open(FILE_PATH.as_ptr() as *const i8, libc::O_RDONLY); + let first = libc::open(FILE_PATH.as_ptr() as *const c_char, libc::O_RDONLY); assert!(first >= 0); - let second = libc::open(FILE_PATH.as_ptr() as *const i8, libc::O_RDONLY); + let second = libc::open(FILE_PATH.as_ptr() as *const c_char, libc::O_RDONLY); assert!(second >= 0); let fds: Vec<RawFd> = vec![0, 1, 2, first]; if j.fork(Some(&fds)).unwrap() == 0 { |