]> Savannah Git Hosting - gnulib.git/commitdiff
boot-time: Make it work on Adélie Linux.
authorBruno Haible <bruno@clisp.org>
Thu, 16 Nov 2023 13:06:29 +0000 (14:06 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 16 Nov 2023 13:06:29 +0000 (14:06 +0100)
* lib/boot-time.c (get_boot_time_uncached): Invoke Linux fallbacks also
on Linux systems that have neither <utmp.h> nor <utmpx.h>.

ChangeLog
lib/boot-time.c

index 9132fef8755d625c0c6fd465decd3682c0d96525..8b9c3344eb45e03353cde4f4f353d499fd6f5298 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-11-16  Bruno Haible  <bruno@clisp.org>
+
+       boot-time: Make it work on Adélie Linux.
+       * lib/boot-time.c (get_boot_time_uncached): Invoke Linux fallbacks also
+       on Linux systems that have neither <utmp.h> nor <utmpx.h>.
+
 2023-11-15  Bruno Haible  <bruno@clisp.org>
 
        obstack: Modernize, fixing several problems.
index fe5b5b88c8eea5682731d859f30345c473a978c2..70329c3aa5e60924d5f30ac4210e2ff56f3ddd43 100644 (file)
@@ -203,7 +203,14 @@ get_boot_time_uncached (struct timespec *p_boot_time)
     }
 #  endif
 
-# else /* old FreeBSD, OpenBSD, native Windows */
+# else /* Adélie Linux, old FreeBSD, OpenBSD, native Windows */
+
+#  if defined __linux__ && !defined __ANDROID__
+  /* Workaround for Adélie Linux:  */
+  get_linux_boot_time_fallback (&found_boot_time);
+  if (found_boot_time.tv_sec == 0)
+    get_linux_boot_time_final_fallback (&found_boot_time);
+#  endif
 
 #  if defined __OpenBSD__
   /* Workaround for OpenBSD:  */