]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: add fallback if SYS_settimeofday does not exist
authorKarel Zak <kzak@redhat.com>
Tue, 11 Aug 2020 09:02:31 +0000 (11:02 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 11 Aug 2020 09:02:31 +0000 (11:02 +0200)
It seems Musl-C removes SYS_settimeofday macro at all.

Addresses: https://github.com/karelzak/util-linux/commit/9c6139a72017cecb9145e46102152cb4f456ada6#commitcomment-41290951
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/hwclock.c

index ac4f9c7538c2f4efdb8763547dd53d956351b319..ac74549d744d318f371b33a2b985f45720e4e066 100644 (file)
@@ -675,6 +675,10 @@ display_time(struct timeval hwctime)
  */
 #define __set_time(_tv)                settimeofday(_tv, NULL)
 
+#if !defined(SYS_settimeofday) && defined(__NR_settimeofday)
+# define SYS_settimeofday      __NR_settimeofday
+#endif
+
 static inline int __set_timezone(const struct timezone *tz)
 {
 #ifdef SYS_settimeofday