Skip to content

Commit 2552563

Browse files
author
Armelle Laine
committed
libs: binder: trusty: binder_rpc_test to use CLOCK_BOOTTIME
all other clock types are not supported in Trusty Bug: 369265611 Change-Id: Ia0a99fba01d8e1b6f73a140ec11711d1d6566a32
1 parent 51b2f8f commit 2552563

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • libs/binder/trusty/rust/binder_rpc_test

libs/binder/trusty/rust/binder_rpc_test/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use binder::{BinderFeatures, IBinder, Status, StatusCode, Strong};
1919
use binder_rpc_test_aidl::aidl::IBinderRpcSession::{BnBinderRpcSession, IBinderRpcSession};
2020
use binder_rpc_test_aidl::aidl::IBinderRpcTest::{BnBinderRpcTest, IBinderRpcTest};
2121
use binder_rpc_test_session::MyBinderRpcSession;
22-
use libc::{clock_gettime, CLOCK_REALTIME};
22+
use libc::{clock_gettime, CLOCK_BOOTTIME};
2323
use rpcbinder::RpcSession;
2424
use trusty_std::ffi::{CString, FallibleCString};
2525

@@ -56,7 +56,7 @@ fn get_time_ns() -> u64 {
5656
let mut ts = libc::timespec { tv_sec: 0, tv_nsec: 0 };
5757

5858
// Safety: Passing valid pointer to variable ts which lives past end of call
59-
assert_eq!(unsafe { clock_gettime(CLOCK_REALTIME, &mut ts) }, 0);
59+
assert_eq!(unsafe { clock_gettime(CLOCK_BOOTTIME, &mut ts) }, 0);
6060

6161
ts.tv_sec as u64 * 1_000_000_000u64 + ts.tv_nsec as u64
6262
}

0 commit comments

Comments
 (0)