Reported by Po Lu in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00108.html>.
* lib/readutmp.h (BOOT_TIME): Add fallback.
+2023-08-13 Bruno Haible <bruno@clisp.org>
+
+ readutmp, boot-time: Fix compilation error on old Android.
+ Reported by Po Lu in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2023-08/msg00108.html>.
+ * lib/readutmp.h (BOOT_TIME): Add fallback.
+
2023-08-13 Bruno Haible <bruno@clisp.org>
readutmp, boot-time: Fix compilation error on Android API 8.
# define WTMP_FILE "/etc/wtmp"
#endif
+/* In early versions of Android, <utmp.h> did not define BOOT_TIME, only
+ USER_PROCESS. We need to use the value that is defined in newer versions
+ of Android. */
+#if defined __ANDROID__ && !defined BOOT_TIME
+# define BOOT_TIME 2
+#endif
+
/* Some platforms, such as OpenBSD, don't have an ut_type field and don't have
the BOOT_TIME and USER_PROCESS macros. But we want to support them in
'struct gl_utmp'. */