* lib/boot-time-aux.h (get_openbsd_boot_time):
Port to Alpine Linux, which had bogus timestamps on /var/run/utmp.
+2024-05-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ boot-time: port to Alpine 3.20.0_rc2
+ * lib/boot-time-aux.h (get_openbsd_boot_time):
+ Port to Alpine Linux, which had bogus timestamps on /var/run/utmp.
+
2024-05-20 Bruno Haible <bruno@clisp.org>
vasnprintf: Don't abort for pseudo-denormal arguments on macOS 12.
struct stat statbuf;
if (stat (filename, &statbuf) >= 0)
{
- *p_boot_time = get_stat_mtime (&statbuf);
- return 0;
+ struct timespec boot_time = get_stat_mtime (&statbuf);
+ /* On Alpine 3.20.0_rc2 /var/run/utmp was observed with bogus
+ timestamps of ~10 s. Reject timestamps before
+ 2005-07-25 23:34:15 UTC (1122334455), as neither Alpine
+ nor Devuan existed then. */
+ if (boot_time.tv_sec >= 1122334455)
+ {
+ *p_boot_time = boot_time;
+ return 0;
+ }
}
}
return -1;