mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-12-25 04:14:06 +00:00
io_jail: fix missing null terminator for close_fds test
BUG=None TEST=cargo test -p io_jail Change-Id: Ib732daca97cb303ec5013e616e6a7037b11af589 Reviewed-on: https://chromium-review.googlesource.com/1056414 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
parent
5e05a8331d
commit
d913acb984
1 changed files with 1 additions and 1 deletions
|
@ -602,7 +602,7 @@ mod tests {
|
||||||
// Test that open FDs get closed and that FDs in the inherit list are left open.
|
// Test that open FDs get closed and that FDs in the inherit list are left open.
|
||||||
fn close_fds() {
|
fn close_fds() {
|
||||||
unsafe { // Using libc to open/close FDs for testing.
|
unsafe { // Using libc to open/close FDs for testing.
|
||||||
const FILE_PATH: &'static str = "/dev/null";
|
const FILE_PATH: &[u8] = b"/dev/null\0";
|
||||||
let j = Minijail::new().unwrap();
|
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 i8, libc::O_RDONLY);
|
||||||
assert!(first >= 0);
|
assert!(first >= 0);
|
||||||
|
|
Loading…
Reference in a new issue