mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 20:04:20 +00:00
base: syslog: Fix android build
bionic (the android libc) doesn't have shm_open or shm_unlink. TEST=presubmit BUG=b:228881485 Change-Id: Ic0df86387a1110835b1e53a68d249fa3d55803ab Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3803896 Reviewed-by: Devin Moore <devinmoore@google.com> Auto-Submit: Frederick Mayle <fmayle@google.com> Tested-by: Frederick Mayle <fmayle@google.com> Reviewed-by: Dennis Kempin <denniskempin@google.com> Commit-Queue: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
parent
d66dfefb4a
commit
b59b108930
1 changed files with 11 additions and 5 deletions
|
@ -14,11 +14,16 @@ mod tests {
|
|||
use std::io::SeekFrom;
|
||||
use std::os::unix::io::FromRawFd;
|
||||
|
||||
use libc::shm_open;
|
||||
use libc::shm_unlink;
|
||||
use libc::O_CREAT;
|
||||
use libc::O_EXCL;
|
||||
use libc::O_RDWR;
|
||||
cfg_if::cfg_if! {
|
||||
// ANDROID: b/228881485
|
||||
if #[cfg(not(target_os = "android"))] {
|
||||
use libc::shm_open;
|
||||
use libc::shm_unlink;
|
||||
use libc::O_CREAT;
|
||||
use libc::O_EXCL;
|
||||
use libc::O_RDWR;
|
||||
}
|
||||
}
|
||||
|
||||
use crate::syslog::*;
|
||||
|
||||
|
@ -34,6 +39,7 @@ mod tests {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(target_os = "android"))] // ANDROID: b/228881485
|
||||
fn syslog_file() {
|
||||
ensure_inited().unwrap();
|
||||
let shm_name = CStr::from_bytes_with_nul(b"/crosvm_shm\0").unwrap();
|
||||
|
|
Loading…
Reference in a new issue