]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Switch to CLOCK_REALTIME on Android
authorTobias Brunner <tobias@strongswan.org>
Thu, 19 Mar 2020 13:22:56 +0000 (14:22 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 2 Jun 2020 11:57:37 +0000 (13:57 +0200)
This allows measuring the delay between events more accurately if a
device is often suspended.

While CLOCK_BOOTTIME would be preferable, Android's bionic C library
does not support it for condvars.

src/libstrongswan/utils/compat/android.h

index da8de62798b6b30590b2aba9e2e77913c75ad27c..7fbcd94609f1aeae9262a8eb99faa12a9997217e 100644 (file)
@@ -37,6 +37,9 @@
 #define HAVE_PTHREAD_CONDATTR_INIT 1
 #define HAVE_CONDATTR_CLOCK_MONOTONIC 1
 
+#undef TIME_CLOCK_ID
+#define TIME_CLOCK_ID CLOCK_REALTIME
+
 #define HAVE_SYS_CAPABILITY_H 1
 
 #else /* __ANDROID_API__ */