002-hwclock-musl.patch 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. diff -Nur busybox-1.36.1.orig/util-linux/hwclock.c busybox-1.36.1/util-linux/hwclock.c
  2. --- busybox-1.36.1.orig/util-linux/hwclock.c 2021-01-01 11:52:27.000000000 +0100
  3. +++ busybox-1.36.1/util-linux/hwclock.c 2024-04-10 11:18:06.569673535 +0200
  4. @@ -136,10 +136,24 @@
  5. * because "it's deprecated by POSIX, therefore it's fine
  6. * if we gratuitously break stuff" :(
  7. */
  8. -#if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32)
  9. -# define SYS_settimeofday SYS_settimeofday_time32
  10. -#endif
  11. +# if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32)
  12. +# define SYS_settimeofday SYS_settimeofday_time32
  13. +# endif
  14. +# if defined(SYS_settimeofday)
  15. int ret = syscall(SYS_settimeofday, NULL, tz);
  16. +# else
  17. + /* Some new architectures have neither settimeofday nor
  18. + * settimeofday_time32, and the whole kernel timezone handling appears
  19. + * to have been dropped due to some oddities in the API. See:
  20. + *
  21. + * - glibc's commit c3f9aef063 ("Use clock_settime to implement settimeofday.")
  22. + * - https://github.com/systemd/systemd/issues/13305
  23. + * - https://inbox.sourceware.org/libc-alpha/cb015d0d1d29e4b948c7118c5b12ff2bed83a6ec.1561421042.git.alistair.francis@wdc.com/
  24. + *
  25. + * So instead just silently drop these calls.
  26. + */
  27. + int ret = -ENOSYS;
  28. +# endif
  29. #else
  30. int ret = settimeofday(NULL, tz);
  31. #endif